Running Simple Python Scripts

Question

I get stuck at Running Simple Python Scripts can anyone help me

1 Like

What is Chech for arguments passed to file?

The arguments mentioned are the terms that follow the script at the command line.
In your example:

$ python main.py John Doe

“John” and “Doe” are arguments that are used by the script main.py to construct the output:

_________________________________
First name: John
Last name: Doe
_________________________________

Inside the script, sys.argv[1] contains first argument, and sys.argv[2] contains the second argument.

The first test say its incomplete what is wrong in the code?

Try writing Python3 main.py John Doe.

Thanks Bro it worked

1 Like