-1
command = ""
while command != "quit":
    command = input("> ").lower()
    if command == "start":
    print("car started . . .   ")
    elif command == "stop":
    print("car stopped ..... ")
    elif command == "help":
        print(""" 
        start _ start the car
        stop _ stop the car
        quit _ exit """)
   else:
    print("i dont understand")  

Every time i try this code i get

print("car started ... ") indentation error. expected an indented block. i use the pydriod 3

  • 1
    You need to read a Python tutorial. The first thing you learn when programming Python is that indentation is critical. The lines under `if` have to be indented. – Barmar Apr 27 '22 at 03:35

1 Answers1

0

You have several indention errors, try with this:

command = ""
while command != "quit":
    command = input("> ").lower()
    if command == "start":
        print("car started . . .   ")
    elif command == "stop":
        print("car stopped ..... ")
    elif command == "help":
        print(""" 
        start _ start the car
        stop _ stop the car
        quit _ exit """)
    else:
        print("i dont understand") 
Brad Figueroa
  • 869
  • 6
  • 15