Wednesday 15 September 2010

runtime error - Expected indented block in Python -



runtime error - Expected indented block in Python -

this question has reply here:

python: i'm getting 'indented block' error on lastly 3 quotes (“”") of comments under functions. what's up? 2 answers

i'm new python, , next part of program:

while g != s , t < 8: g = input("what guess? ") if g < s: print ("too low...") elif g > s: print ("too high...") t = t + 1

i error:

expected indented block

why that? and, how can issue solved?

thanks.

python based on whitespace ... need indent in block (in other languages utilize curly braces)

while g != s , t < 8: #indented 0 spaces #every thing below part of block needs indented g = input("what guess? ") #indented 4 if g < s: #indented 4 spaces #this happens when low (one line indented) print ("too low...") #indented 8 spaces elif g > s: #indented 4 spaces #this happens when high(one line indented) print ("too high...") #indented 8 spaces # happens every iteration of loop t = t + 1 #indented 4 spaces

python runtime-error block

No comments:

Post a Comment