Python Forum
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calculator
#6
First, you're doing the same thing twice. You have two functions that are basically identical. Make one function that gets a number, and use that function twice.

Second, follow the code. What happens when you have an invalid input? It goes into the except block, and calls itself again recursively. What does it do with the result of calling itself? Nothing. You need to return the result of the function calling itself. (return num_1())
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
calculator - by Jei - Dec-14-2016, 11:50 AM
RE: calculator - by sparkz_alot - Dec-14-2016, 02:29 PM
RE: calculator - by Jei - Dec-14-2016, 02:53 PM
RE: calculator - by sparkz_alot - Dec-14-2016, 03:03 PM
RE: calculator - by Jei - Dec-14-2016, 03:09 PM
RE: calculator - by ichabod801 - Dec-15-2016, 02:35 AM

Forum Jump:

User Panel Messages

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