Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

12 bytes added, 11:39, 2 June 2017
PART 1 - Providing Functions With Arguments
return 'perfect'
return 'ok'
</source>'''FYI:''' Remember that you MUST consistently '''indent ALL code''' for within each logic section (or test): otherwise, it may not allow the logic statement to work correctly. The final '''return "ok"''' will only take place if a previous return has not taken place before it. Once return has been used in a function, the function immediately exits and returns the value.
:#Issue the following functions (with arguments) to confirm the results:<source>
check_temperature(50)
print(operate(10, 5, 'divide'))
</source>
:::*The operate() function should use '''logic''' statements<br> &nbsp; '''FYI:''' Remember that you MUST consistently '''indent ALL code''' for within each logic section (or test): otherwise, it may not allow the logic statement to work correctly.
:::*The operate() function should accept '''three arguments'''
:::*The operate() function should '''return''' the result
13,420
edits