Solutions
Ex 1.
import turtle
import random
colors = ["red", "green", "blue", "yellow", "orange", "purple"]
turtle.speed(10)
for a in range(100):
choice = random.randrange(4)
turtle.color(colors[choice])
turtle.forward(100)
turtle.left(92)
Ex 2.
import turtle
import random
colors = ["red", "green", "blue", "yellow", "orange", "purple"]
turtle.speed(10)
for a in range(100):
choice = random.randrange(4)
turtle.color(colors[choice])
turtle.forward(a)
turtle.left(92)
Ex 3.
import turtle
for a in range(20):
turtle.circle(a * 5)
Ex 4.
import turtle
for a in range(20):
turtle.circle(a * 5)
turtle.up()
turtle.right(90)
turtle.forward(5)
turtle.left(90)
turtle.down()