Norman Khine wrote:
 >>> i = 5
 >>> j = 7
 >>> if i <= j:
...     print 'nudge', 'nudge'
... else:
...     print 'whatever'
...
nudge nudge
 >>>


WM. wrote:
 >>> i = 5
 >>> j = 7
 >>> if i <= j:
    print 'nudge, nudge'
          else:
         File "<pyshell#8>", line 3
    else:
   ^
IndentationError: unexpected indent

Running in IDLE, all is well until "else:". IDLE seems perplexed about the >>>s. I try to de-dent else via the backspace key, after that there is no way to avoid an error message.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor



Yes, I understand how your program works. What I do not understand is how you got it. My program came out in IDLE as you see it. No ..., different indentation, an error message before I could add the else alternative. (Which, as a Pythonista, one should know, is "Wink-wink".)
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to