Print the first parameter
Created on Dec. 9, 2016 by Julien Palard
Write a script that print the first parameter given to the script.
Warning
You should work on this exercise with your own installation of Python, on your computer. Learn how for Mac OSX or Windows.
If there is no parameters given, it should print the following error message on stdout:
usage: python3 solution.py PARAM
Advice
Maybe you'll need to import a few modules in your program.
Example
1 2 3 4 5 6 7 |
|
references
if: https://docs.python.org/3/reference/compound_stmts.html#if
sys.argv: https://docs.python.org/3/library/sys.html#sys.argv