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

Turtle Colors

  • Named Colors See the names
  • Hex Code - use a color picker
  • Color Tuple r,g,b each one goes from 0-1
  • color
  • pencolor
  • fillcolor
  • s.bgcolor
  • begin_fill + end_fill
import turtle

t = turtle.getturtle()

t.forward(50)

t.color("blue")
t.forward(50)

t.color("green", "yellow")
t.forward(50)

t.pencolor("purple")
t.fillcolor("orange")
t.forward(50)


turtle.exitonclick()
import turtle

t = turtle.getturtle()

t.fillcolor("orange")

t.begin_fill()
t.circle(30)

t.end_fill()

turtle.exitonclick()