Changes

Jump to: navigation, search

OPS435 Python Lab 3

444 bytes removed, 09:30, 1 June 2017
PART 2 - Providing Functions With Arguments
:::'''Python Script Template'''
::::<source>#!/usr/bin/env python3
def sum_numbers(number1, number2):
# Make this function add number1 and number2 and return the value
if __name__ == '__main__'def subtract_numbers(number1, number2): print(operate(10, 5, 'add'))# Make this function subtract number1 and number2 and return the value print(operate# Remember to make sure the function accepts 2 arguments def multiply_numbers(10, 5number1, 'subtract')number2): print(operate(10, 5, '# Make this function multiply'))number1 and number2 and return the value print(operate(10, 5, 'divide'))# Remember to make sure the function accepts 2 arguments   
</source>
:::'''Additional Requirements'''
:::*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 accept two arguments
:::*All functions should return an integer
13,420
edits

Navigation menu