[Tutor] [tutor] IDLE

Alan Gauld alan.gauld at btinternet.com
Thu Feb 12 10:10:01 CET 2009


"WM." <wferguson1 at socal.rr.com> wrote

> IDLE also now works perfectly, whether I open into IDLE or edit 
> window.
> Below is a copy/paste:
>
> IDLE 2.6
> >>> i = 9
> >>> while i > 2:
>             print i
>             i -= 1

The problem occurs when you go to a second level block:

>>> if 42 > 66:
                print 'false'
else:
                print 'true'

Whjat happens is a beginner will try to align the else with the if as 
shown
in the text books etc anmd get an error from IDLE. Whereas if IDLE
provided the ... secondary prompt it would look like:

>>> if 42 > 66:
...                print 'false'
...    else:
...                print 'true'

Which matches the text books.

Alan G 




More information about the Tutor mailing list