[Tutor] indent error on if/elif/else

richard kappler richkappler at gmail.com
Thu Sep 10 17:38:54 CEST 2015


Here's my code, no tabs were used, all whitespace verified made with
spacebar:

print("Please enter a number for feed speed...")
print("1 - Batch")
print("2 - 2 per second")
print("3 - Real Time")
print("4 - Exit")

if x == ord('1'):
    delay = 0
elif x == ord('2'):
    delay = 0.5
elif x == ord('3'):
    # set delay real time
    # read timestamp from line, create an offset
    # send lin iaw server time with offset
else:
    print("bad choice, exiting")
    os.exit()

#################

Here's the Traceback:

  File "dataFeedTest.py", line 44
    else:
       ^
IndentationError: expected an indented block


Not a clue why it's doing this. Any help?

regards, Richard

-- 

All internal models of the world are approximate. ~ Sebastian Thrun


More information about the Tutor mailing list