Mar-08-2018, 10:52 PM
(This post was last modified: Mar-08-2018, 10:56 PM by trent101010.)
Quote:Without really getting into the code (there are a number of errors), I would say you need to indent your first if/else statement. In comparisons, you need to use '==' not '='. Change your first 'else' to an 'elif == i' and so on.I got a bad input error on line 8
To get you started, basically you wantprint("Math God") print("Welcome to Math God! Made by Trent in 2018!") print("In this game, you have a minute to answer the math problem correctly. If you get it wrong or run out of time, you get a strike. Three strikes and the game is over.") while True: x = input("There are three modes to this game: quadratic, interest, and order of operations. Type 'q' for quadratics, 'i' for interest, and 'o' for order of ops.") try: if x == 'q': print("You have selected quadratics. Press any key to start.") elif x == 'i': print("You have selected interest. Press any key to start.") elif x == 'o': print("You have selected order of operations. Press any key to start.") except: print("Sorry, but you didn't correctly choose a valid mode. Press any key to continue.") # return
Quote:Fix the indentation to equal spaces. The if block inside the try/except must be indented.I was just trying for the other inputs to make a "Press any key to continue." kind of thing.
You can't use just input() in a script without an assignment.