Python Forum
Calculator: several options, changing the number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculator: several options, changing the number
#4
Text on top of the window suggests the grader expects the function to return 0 upon completion. Try if this works:

    if select == 1:
        print("The result is:", number1 + number2)
        return 0
    elif select == 2:
        print("The result is:", (number1 - number2))
        return 0
    elif select == 3:
        print("The result is:", number1 * number2)
        return 0
    elif select == 4:
        print("The result is:", number1 / number2)
        return 0
Otherwise return is expected at a different point in program, which you should be able to figure from the task instructions.
Reply


Messages In This Thread
RE: Calculator: several options, changing the number - by j.crater - Dec-28-2019, 10:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list all the different options that are filled in oog70 1 1,926 Sep-13-2019, 03:33 PM
Last Post: ichabod801
  python age calculator need to find the number of years before they turn 100 not using orangevalley 4 10,062 Mar-26-2018, 04:44 AM
Last Post: PyMan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020