I'm writing calculator with Python and i came across few problems.
First problem is that if user enters letters it would ask him to reenter them i thought i could do it like this
try: class num: x = float(raw_input("number\n")) numb = num() except: bull = False else: bull = True if bull == False: import vartype2 else: print "aha"
but import statement imports it only once and i have no clues how to fix it.
Second problem is that when if i want to continue counting i need to restart the program all over again i tried something like this
dothis = raw_input("Do you want to continue?\n") while dothis != "y" and dothis != "ye" and dothis != "yes": print raw_input("Press Enter to exit\n") break else: import calc1
but once again import statement imports it only once.
How could i fix these bugs?