The objective of this project is to use the random and turtle modules to create the image below. I changed the color of the window to red and the pen color to white. I had to make the turtle turn right to a random angle between 0 and 45, move to a random number between 0 and 150, then move back the same number of steps it moved forward, then finally repeat these 3 steps 100 times.
import random
import turtle
canvas = turtle.Screen()
canvas.bgcolor(“red”)
t = turtle.Turtle()
t.pencolor(“white”)
for x in range(100):
randomDegree = random.randrange(0, 45)
randomSteps = random.randrange(0, 150)
t.right(randomDegree)
t.forward(randomSteps)
t.backward(randomSteps)