lab 2 ; turtle blast

used the python shell to write out the code for my turtle. I named my turtle billy, i made him loop around 100 times. I then saved it and took a screenshot of billy’s track.

>>> import turtle
>>> wn=turtle.Screen()
>>> wn.bgcolor(“red”)
>>> billy=turtle.Turtle()
>>> billy.color(“white”)
>>> for i in range(100):
import random
a=random.randrange(1,45)
b=random.randrange(1,150)
billy.right(a)
billy.forward(b)
billy.backward(b)

Untitled

Leave a Reply

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