On Wed, Jan 7, 2009 at 5:28 AM, A.T.Hofkamp <[email protected]> wrote: > WM. wrote: >> >> Norman Khine wrote: >>> >>> >>> i = 5 >>> >>> j = 7 >>> >>> if i <= j: >>> ... print 'nudge', 'nudge' >>> ... else: >>> ... print 'whatever' >>> ... >>> nudge nudge >>> >>> > >> 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".) > > In IDLE in the window with the ">>>" prompt: > > After the colon at the 'if' line, you press ENTER (ie you tell Python 'the > line has ended here'). > The interpreter then supplies the "..." to denote that you are entering a > multi-line statement.
No, IDLE does not supply the ..., that is the source of the confusion. If you use the interpreter directly from a command/terminal window it will supply the ... continuation prompt but the IDLE shell will not. Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
