Changes

Jump to: navigation, search

OPS435 Python Lab 3

94 bytes removed, 12:46, 2 June 2017
PART 1 - Providing Functions With Arguments
sum_numbers(5, 10)
sum_numbers(50, 100)
</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>
:#Issue the following to issue a function within another function:<source>
square(sum_numbers(5, 5))
</source> Was '''NOTE:''' Running functions with multiple arguments is the same. When you put a function as a argument of another function, the result '''inner-most function will run first''', and the return the value '''10''' from running this 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 these arguments what you though it would be?that value '''square(10)'''.<br><br>
'''Practice Creating Functions that Accept and Return Values'''
13,420
edits

Navigation menu