0
I keep getting a "illegal target for annotation" & "unexpected token else" WHY?????
command = "" started = False while True: command=input("> ").lower() if command=="start": if started: print("Car is already started") else: started = True print("The car is started...") elif command=="stop": if not started: print("The car is already stopped!") #this line below is where my error is else: started = False print("The car has stopped.") elif command=="help": print(""" start - to start the car stop - to stop the car quit - to quit """) elif command=="quit": break else: print ("???")
4 ответов
0
The else immediately below where your comment is needs to be de-intented so that it is in line with the if two lines above.
+ 1
Thanks Russ its runnin' smoothly!!!
0
https://code.sololearn.com/cYEa6142HBOp/?ref=app
Here's the code in question
0
Kirsten Leonard Glad to hear!