To draw a Inside out spiral using Python Turtle Graphics - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Tuesday, June 30, 2020

To draw a Inside out spiral using Python Turtle Graphics









Question

To draw a Inside out spiral using Python Turtle Graphics.

Sample TestCase Expected Output

  










Answer



import turtle  #Inside_Out 
wn = turtle.Screen() 
wn.bgcolor("light green") 
skk = turtle.Turtle() 
skk.color("blue") 
  
def sqrfunc(size): 
    for i in range(4): 
        skk.fd(size) 
        skk.left(90) 
        size = size + 5
  
sqrfunc(6) 
sqrfunc(26) 
sqrfunc(46) 
sqrfunc(66) 
sqrfunc(86) 
sqrfunc(106) 
sqrfunc(126) 
sqrfunc(146) 

Follow Us For More...

6 comments: