from turtle import *
import math
penup()
goto(40, 25)
right(90)
pendown()
for i in range(40):
if(heading() == 0):
color(“red”)
elif(heading() == 90):
color(“black”)
elif(heading() == 180):
color(“green”)
elif(heading() == 270):
color(“pink”)
distance = 20 * (i+1);
forward(distance)
right(90)
penup()