import turtle import random def draw_tree(x, y, color): tom.penup() tom.goto(x, y) tom.begin_fill() tom.color(color) tom.pendown() tom.right(90) tom.forward(60) tom.left(90) tom.forward(40) tom.left(90) tom.forward(60) tom.right(90) tom.forward(120) tom.left(145) tom.forward(140) tom.right(145) tom.forward(90) tom.left(145) tom.forward(120) tom.right(145) tom.forward(60) tom.left(145) tom.forward(90) tom.left(70) tom.forward(90) tom.left(145) tom.forward(60) tom.right(145) tom.forward(120) tom.left(145) tom.forward(90) tom.right(145) tom.forward(140) tom.left(145) tom.forward(120) tom.end_fill() # main process wm = turtle.Screen() wm.bgcolor("wheat") tom = turtle.Turtle() tom.speed(0) # draw_tree(200, 0, "chocolate") # draw_tree(60, -100, "brown") # draw_tree(-80, -200, "saddlebrown") # colors = ["chocolate", "saddlebrown", "brown"] # x = 200 # y = 0 # for i in range(3): # draw_tree(x, y, colors[i]) # x -= 120 # y -= 100 colors = ["chocolate", "saddlebrown", "brown"] for i in range(3): x = random.randint(-200, 200) y = random.randint(-200, 200) draw_tree(x, y, colors[i]) wm.mainloop()