An endless loop

Ian Kelly ian.g.kelly at gmail.com
Mon Oct 16 13:09:39 EDT 2017


On Sat, Oct 14, 2017 at 8:10 PM, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
>   I made an error I made a thousand times before.
>
>   I had programmed an endless loop.
>
>   But never did I see before so clear why it's called
>   an endless loop. (Tested in IDLE.)
>
> from turtle import *
>
> reset(); reset(); shape( 'turtle' ); showturtle()
>
> def poly( n, length ):
>     i = 0
>     while i < n:
>         forward( length )
>         left( 360/n )
>
> poly( 5, 100 )
> done()

I honestly can't remember the last time I programmed an endless loop,
and I also can't remember the last time I used a while loop.

Those two things are probably related.



More information about the Python-list mailing list