 Hi. In this video, we're going to talk about command line arguments in Python programming language. When you want to run a program for a terminal window, sometimes you want to provide additional options for your program, and you can provide these options by using command line arguments. In Python, you can make a program that you can run with additional command line arguments. For example, if you have a file, example.py, you can run it in the terminal by using py command, or you can provide additional arguments after your Python file. I will provide, for example, argument 1, argument 2, argument 3, and so on. System is going to put each optional argument in a list of strings, and this list is called sys.arguments values. The first string in this list is the program's file name. So the first string in our list is going to be in this case, example.py. And the second string inside this list is going to be argument 1 and so on. Okay, let's make an example with usage of command line arguments. Let's make a new file. If we want to use this list of command line arguments, we need to import sys module. Let's make a simple example in which we want to get from a command line 1 argument that argument is going to be a number, and that number will tell us how many times we want to print the text hello world to the screen. And by default, if we do not provide an argument from the command line, we're going to print this text hello world just once. So by default, the number of iterations in our loop is going to be one. But let's ask if we have in this list of arguments at least two arguments or exactly two arguments. Because the first argument is going to be let's say that we're going to call our file example.py. First argument is going to be the file name. And the second argument is going to be our number. We want to get this number and inside our sys.irg we're going to have two strings. And if we have two strings, we want to use the second one and second one is going to have index one inside our list. So we want to use this second argument is a second argument is going to have index one because the first argument is going to have index zero. First argument is going to be file name. And the second argument is going to be a number that we want to provide. So in this case, first argument is a file name and the second argument is our number. So we're going to use this index, I will delete all this and I want to get a number from command line and to modify our variable number and assign the value of argument to our variable number. And then I will make a simple for loop and I will loop it at least once if our argument number is not provided and I'm going to loop it a number of times if this number is provided as second argument to our command line. So we're going to print a text, hello world, okay. Now I'm going to save this file as example dot py and I will use command line to run it. Okay, we got a problem. We need to explicitly convert this command line argument into integer because by default arguments from this list, they are strings. So we're going to convert it to a number file is not saved. Okay, let's try it again. And as you can see this text hello world is printed five times. And if we provide for example number three, that means that we're going to print three times this text and if we do not provide any number as an argument, then this text is going to be printed just once. That's all in this video. Thanks for watching. Don't forget to subscribe to my channel and to watch other videos from my channel. See you in the next video.