Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

42 bytes added, 09:20, 31 May 2017
PART 1 - Using Functions
:::*The script should have a '''Shebang line'''
:::*Below the '''Shebang line''', add an '''empty line ''' followed by a comment stating: '''"#return_text_value() function"''':::*Add an '''empty line ''' followed by the '''return_text_value()''' function '''definition ''' that you previously entered in the shell.:::*Add another '''empty line ''' followed by a comment stating: '''"#return_number_value() function"''':::*Add another '''empty line ''' following by the '''return_number_value()''' function '''definition ''' that you previously entered in the shell.:::*Add a '''couple of empty lines''', following by a comment stating: '''"#Main Program"''':::*Add another '''couple of empty lines''', followed by the statements displayed below:<source>
# This IF Statement may seem cryptic and unclear. Any code written under this IF statement will be run when you run your script.
#if __name__ == '__main__':
13,420
edits