Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

98 bytes removed, 10:31, 2 June 2017
PART 1 - Providing Functions With Arguments
print(operate(10, 5, 'divide'))
</source>
:::*The script operate() function should have a use '''Shebang linelogic'''statements:::*The script should have a function operate(num1, num2, operator):::*The script should use if statements inside the operate function:::*The operate function should accept '''three arguments''':::*The operate () function should '''return ''' the answerresult:::*The operate () function should '''return a ''' an error message if the operation is unknown
:::*The script should contain show the exact output as the sample imports
:::*The script should contain no errors
13,420
edits