Lab 2

Lab Description

This lab features the creation and execution of a code program called turtle to create an image.

Code

import turtle
import random
wn = turtle.Screen()
wn.bgcolor(“red”)
Tho = turtle.Turtle()
Tho.pencolor(“white”)
for x in range (100):
Tho.right(random. randint(0, 45))
distance=random.randint(0, 150)
Tho.forward(distance)
Tho.backward(distance)

Screenshot

 

 

 

untitled T

Leave a Reply

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