[Tutor] Interactive programming.
Kent Johnson
kent37 at tds.net
Wed Jan 7 12:32:01 CET 2009
On Wed, Jan 7, 2009 at 5:28 AM, A.T.Hofkamp <a.t.hofkamp at tue.nl> 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
More information about the Tutor
mailing list