Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

10 bytes added, 09:09, 26 May 2017
PART 1 - Using IF Statements
:::'''Input / Output / Processing Requirements'''
:::*The script should have a '''Shebang line''':::*The script should '''import sys''':::*The script should print a '''usage message''' IF additional arguments are NOT provided when running script:::*The script should '''exit''' (or 'abort') if two additional arguments are not provided when running script:::*The script should use a variable called '''name''':::*The script should use a variable called '''age''':::*The script should use '''sys.argv[1]''' (first argument):::*The script should use '''sys.argv[2]''' (second argument):::*The script should store the values in the correct variables:::*The script should print the EXACT OUTPUT as shown
:::'''Sample run 1:'''<source>
13,420
edits