Below is my entire code. When trying to execute it, I keep getting the error message
File "/Users/thomas/prac.py", line 15
elif choice == "1":
IndentationError: expected an indented block
Now I’m sure my indenting is right (I didn’t mix tabs and spaces!) but I don’t know why this isn’t working:
keepProgramRunning = True
while keepProgramRunning:
print "Pleases choose an option: "
print "0"
print "1"
choice = raw_input()
if choice == "0":
#do something
elif choice == "1":
print "Bye"
keepProgramRunning = False
else:
print "try again"
What’s wrong?
A comment isn’t enough to be considered an indentation. If you want to have an empty block then you need to use the
passstatement.