Changes

Jump to: navigation, search

OPS435 Python Lab 3

201 bytes added, 10:35, 31 May 2017
PART 2 - Providing Functions With Arguments
def sum_numbers(number1, number2):
return int(number1) + int(number2)
</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 value will be used as the argument on the outer function. For example, in this case below, '''sum_numbers(5, 5)''' will return '''10''', and provide square with that value '''square( 10 )'''.<br><br>:#Issue the following to test out passing multiple arguments to the sum_numbers() function:<source>
sum_numbers(5, 10)
sum_numbers(50, 100)
square(sum_numbers(5, 5))
</source>Was the result from running this function with these arguments what you though it would be?
'''Practice Creating Functions With Return Values'''
13,420
edits

Navigation menu