Animations and Interactive Programming
Drawing a Single Spiral
import turtle
wn = turtle.Screen()
wn.bgcolor("light green")
wn.title("Turtle")
turtle1 = turtle.Turtle()
turtle1.color("blue")
def sqrfunc(size):
for i in range(4):
turtle1.fd(size)
turtle1.left(90)
size = size-5
sqrfunc(146)
sqrfunc(126)
sqrfunc(106)
sqrfunc(86)
sqrfunc(66)
sqrfunc(46)
sqrfunc(26)
turtle.done()
Practice: Implement the code without making multiple calls to the sqrfunc().