Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

33 bytes added, 11:08, 31 May 2017
PART 2 - Providing Functions With Arguments
:::*The script should have a '''Shebang line'''
:::*The script should have a function called '''sum_numbers(number1, number2)''':
:::: Make this function add number1 and number2 and return the value
:::*The script should have a function '''subtract_numbers(number1, number2)''':
:::: Make this function subtract number1 and number2 and return the value
:::: Remember to make sure the function accepts 2 arguments
:::*The script should have a function '''multiply_numbers(number1, number2)''':
:::: Make this function multiply number1 and number2 and return the value
:::: Remember to make sure the function accepts 2 arguments
:::*All functions should return an integer
:::*The script should contain no errors
 :::2. '''Sample Run 1:'''<source>
run lab3b.py
15
50
</source>
:::3. '''Sample Import 1:'''<source>
ipython3
20
</source>
 :::42. Exit the ipython3 shell, download the checking script and check your work. Enter the following commands from the bash shell.<source>
cd ~/ops435/lab3/
pwd #confirm that you are in the right directory
python3 ./CheckLab3.py -f -v lab3b
</source>
 :::53. Before proceeding, make certain that you identify any and all errors in lab3b.py. When the check script tells you everything is ok before proceeding to the next step.
'''Multiple Arguments and IF Statements'''
13,420
edits