Its super easy to code and so much fun. Try out this program and the code is following :
# importing turtle moduleimport turtle
# number of sidesn = 10
# creating instance of turtlepen = turtle.Turtle()
# loop to draw a sidefor i in range(n): # drawing side of # length i*10 pen.forward(i * 10)
# changing direction of pen # by 144 degree in clockwise pen.right(144)
# closing the instance# importing turtle moduleimport turtle
# number of sidesn = 100
# creating instance of turtlepen = turtle.Turtle()
# loop to draw a sidefor i in range(n): # drawing side of # length i*10 pen.forward(i * 10)
# changing direction of pen # by 144 degree in clockwise pen.right(144)
# closing the instanceturtle.done()
0 Comments