Turtle graphics

 

Description:

This project is about  turtle forward a random distance between 0 and 150 pixels and 45 angle in red background. it make line randomly. HERE IS CODE FOR THIS PROJECT:

import turtle
import random

t = turtle.Turtle()
r = random.Random()

window = turtle.Screen()

window.bgcolor(‘red’)                                 # it’s for screen color.
t.pencolor(‘white’)                                        #it’s for pen color.

for x in range(100):                                        #range for x
angle = random.randint(0,45)
t.right(angle)                                                     # for angle
distance = random.randint(0,150)
t.forward (distance)
t.backward (distance)
distance = random.randint(0,150)
t.forward (distance)
t.backward (distance)
distance = random.randint(0,150)
t.forward (distance)
t.backward (distance)