Changes

Jump to: navigation, search

OPS435 Python Lab 3

No change in size, 20:02, 11 February 2018
PART 1 - Providing Functions With Arguments
import lab3c
lab3c.operate(10, 20, 'add')
# Will output return 30
lab3c.operate(2, 3, 'add')
# Will output return 5
lab3c.operate(100, 5, 'subtract')
# Will output return 95
lab3c.operate(10, 20, 'subtract')
# Will output return -10
lab3c.operate(5, 5, 'multiply')
# Will output return 25
lab3c.operate(10, 100, 'multiply')
# Will output return 1000
lab3c.operate(100, 5, 'divide')
# Will output return Error: function operator can be "add", "subtract", or "multiply"
lab3c.operate(100, 5, 'power')
# Will output return Error: function operator can be "add", "subtract", or "multiply"
</source>
:::3. Download the checking script and check your work. Enter the following commands from the bash shell.<source lang="bash">

Navigation menu