Lab #2

Untitled

import turtle
import random

wn = turtle.Screen()
wn.bgcolor(“red”)

ed = turtle.Turtle()
ed.pencolor(“white”)
for i in range (100):
ed.right(random.randrange(0,45))
distance = random.randrange(0,150)
ed.forward (distance)
ed.backward (distance)
I manage to do this by Using the turtle and random modules from Python, it was difficult because i had made a couple errors in some  the lines. The mistake i made was in line 8 and 9 , but i corrected them.

Leave a Reply

Your email address will not be published. Required fields are marked *