This assignment helps teaches students the usage of the random module in Turtle. The random module is made to pick any random number between two selected numbers. It can allow the code in turtle to always draw any random line whenever it is activated.
import turtle
import random
window = turtle.Screen()
t = turtle.Turtle()
window.bgcolor (“red”)
t.pencolor (“white”)
for x in range(100):
a = random.randrange(0,45)
i = random.randrange(0,150)
t.left(a)
t.forward(i)
t.forward(-i)