How are you expecting to print add(numOne, numTwo) if the sumOutput variable is local to the add subroutine? You need to return sumOutput, effectively 'popping' the value out of the function and into the print procedure.
x Turn on thread page Beta
Stuck with python code problem watch
- 13-11-2017 02:03
- 01-12-2017 04:48
you are not calling the function do this
if operator ==("add"):
then repeat that for all operators using if/elif/else structure
I used Python 3.6Last edited by justAbout; 01-12-2017 at 04:51.
- 24-12-2017 21:51
The way you called the function is wrong it should be:
if operator == 'add':
*Your parameter in the subroutine should not be same when you're calling the subroutine
- 29-12-2017 22:12
You’re running Python 3 code in a Python 2.7 interpreter, you need the 3.6 interpreter from the Python website other the code will never work.