Amazing Spiral Pattern in Python using the Turtle Library



Hello guys this is Satyam again back with another awesome blog and in this blog I am going to show how you can create an amazing spiral pattern in Python using the turtle feature.So if you don't know about this amazing module you should try to know about it.

Code:

# import turtle module
import turtle
  
# initialising variables
dist = 1
f = 500
  
# initialising turtle
s = turtle.Turtle()
  
# controlling the animation
s.speed(10)
  
# making patten
while f:
    
    # makes the turtle to move forward
    s.forward(dist)
      
    # makes the turtle to move left
    s.left(120)
    s.left(1)
    dist += 1
    f -= 1
turtle.done()



So guys the code is very simple,the main thing is the logic which is used to these.Hope you like this blog.



Thanks for Reading
Share:

Post a Comment

Copyright © DevTipsNTricks. Designed by OddThemes