Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Line

  • getturtle
  • forward
  • exitonclick

Without the call to turtle.exitonclick() at the end of the program it would automatically close the window and we would not be able to see anything. This command installs an event-handler so when we click on the mouse it will end the application.

import turtle

trt = turtle.getturtle()
trt.forward(100)

turtle.exitonclick()