Turn on thread page Beta
    Offline

    15
    ReputationRep:
    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.
    Offline

    1
    ReputationRep:
    you are not calling the function do this
    if operator ==("add"):
    add(numOne,numTwo)

    then repeat that for all operators using if/elif/else structure

    I used Python 3.6
    Offline

    1
    ReputationRep:
    The way you called the function is wrong it should be:
    if operator == 'add':
    add (nos1,nos2)

    *Your parameter in the subroutine should not be same when you're calling the subroutine
    Posted on the TSR App. Download from Apple or Google Play
    Offline

    10
    ReputationRep:
    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.
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: December 29, 2017

University open days

  1. University of Bradford
    University-wide Postgraduate
    Wed, 25 Jul '18
  2. University of Buckingham
    Psychology Taster Tutorial Undergraduate
    Wed, 25 Jul '18
  3. Bournemouth University
    Clearing Campus Visit Undergraduate
    Wed, 1 Aug '18
Poll
How are you feeling in the run-up to Results Day 2018?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.