13,420
edits
Changes
→PART 1 - Providing Functions With Arguments
</source>'''NOTE:''' Running functions with multiple arguments is the same. When you put a function as a argument of another function, the '''inner-most function will run first''', and the return the value '''10''' from the will be used as the argument for the '''outer function'''. In the example below, '''sum_numbers(5, 5)''' will return '''10''', thus providing that result to be square with that value '''square(10)'''.<br><br>
'''Practice Creating Functions a Function that Accept Accepts Arguments and Return ValuesReturns a Value'''
:It is time to practice creating a shell script that uses functions a function that accepts values as arguments that are then used by the functions for processing, and returns a value.
:'''Perform the Following Instructions:'''
:#Create a new script '''~/ops435/lab3/lab3b.py'''. Refer to the '''Python Script template''' and the '''Additional Requirements''' sections when creating your Python script. Refer to Sample Run and Sample Imports displayed below for exact prompt and output
def sum_numbers(number1, number2):
</source>
run lab3b.py
15
50
</source>
import lab3b
</source>
cd ~/ops435/lab3/
pwd #confirm that you are in the right directory
</source>
'''Passing up Multiple Arguments and Using Logic Statements'''