Ian D wrote: > I am trying to exit a while loop whilst using turtle graphics. > I don't seem to have the logic correct at all. > I have tried a few different things > > These might seem a bit illogical to you guys but to me they make some > sense, sadly > > I just don't really grasp these while loops and their usage.(obviously) > > I am trying to find a way to use a while loop with the turtle graphics
The following seems to work: import turtle def quit(): global more more = False turtle.onkey(quit, "Up") turtle.listen() more = True while more: turtle.left(100) turtle.forward(300) _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor