Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

38 bytes removed, 11:44, 1 August 2017
PART 1 - Using IF Statements
:::*The script should '''import sys'''
:::*The script should print a '''usage message''' if zero arguments present, or likewise, if not exactly 2 arguments are NOT provided when running script<br>(NOTE: Use '''sys.argv[0]''' value in this message in case you rename the script at a later date!)
:::*The script should use '''sys.exit()''' (i.e. without attempting to 'abort' script) do any more work if zero arguments, or likewise, if not exactly 2 arguments are not provided when running script
:::*The script should use a variable called '''name'''
:::*The script should use a variable called '''age'''