Change the background colour of the Turtle's window
import turtle window = turtle.Screen() window.bgcolor("lightgreen") window.title("Light Green World")
You can choose between the standard colours "white", "black", "red", "green", "blue", "cyan", "yellow", and "magenta"
Two turtles working independently - Alex and Tess
alex = turtle.Turtle() alex.shape("turtle")
tess = turtle.Turtle() tess.shape("square")
for i in range(numberofsides): tess.right(360/numberofsides) tess.forward(100) alex.right(180-(180/numberofsides)) alex.forward(120)
You can create as many turtles as you want.
Multi-coloured output
mycolors = ["red","yellow","green","blue","purple","black"] for i in mycolors: turtle.color(i) turtle.forward(100) turtle.right(60)
Using 'stamp()' to draw a picture at the position
turtle.shape("turtle") turtle.penup() # Don't draw a line size = 20 for i in range(30): turtle.stamp() # Leave an impression size = size + 3 # Increase the size turtle.forward(size) # Move tess along turtle.right(24) # ... and turn her
using turtle.goto() to move directly to a position
for i in range(12): turtle.penup() # stops drawing turtle.goto(0,0) turtle.right(360/12) turtle.pendown() # starts drawing turtle.forward(100)