using "else: interactive programme

nikie n.estner at gmx.de
Sun Mar 26 09:01:09 EST 2006


I guess the indention got mixed up in your post, if I try to run it, I
get error messages at each of the "else:" lines, because they're
mis-indented.
"else" should be indented like the "if" it belongs to, e.g (using
underscores for spaces):
if s=='10':
____print "well done"
else:
____print "something else"
Make sure you're using tabs/spaces consistently across the whole file,
too.
If I indent the else clauses correctly, I can run your script and it
behaves the way you expeced.




More information about the Python-list mailing list