This code makes a turtle move constantly in random places.
import turtle
import random
wn = turtle.Screen()
wn.bgcolor(‘red’)
alex = turtle.Turtle()
alex.pencolor(‘white’)
alex.speed(5)
angle = random.randint(0,45)
for i in range(100) :
angle = random.randint(0,45)
alex.right(angle)
distance1 = random.randint(0,150)
alex.forward(distance1)
alex.back(distance1)
import turtle
import random
wn = turtle.Screen()
wn.bgcolor(‘red’)
alex = turtle.Turtle()
alex.pencolor(‘white’)
alex.speed(5)
angle = random.randint(0,45)
for i in range(100) :
angle = random.randint(0,45)
alex.right(angle)
distance1 = random.randint(0,150)
alex.forward(distance1)
alex.back(distance1)
import turtle
import random
wn = turtle.Screen() # Set up the window and its attributes
wn.bgcolor(“red”)
tess = turtle.Turtle() # gives me the screen and color blue for blastoff
tess.color(‘blue’)
random.randint
blastoff = random.randrange (1, 45)
turtle.Forward()
turtle.backward()
for i in range (100)