how to make flower type circle spiral with turtle in python in vs code

Опубликовано: 23 Июль 2026
на канале: code with PK
227
23

hi guys ,how are you all
thank you for watching my video

code is here

import turtle #turtle library imported

t = turtle.Turtle() # here we are creating a turtle object or screen on which we are making different shapes
t.speed(0) # speed is 0 which is fastest speed
t.color("cyan") # turtle color is set as cyan
t.pensize(2) # our size of turtle is 2

wn = turtle.Screen() # wn is windows
wn.bgcolor("black") # windows background color is set as black & default color is also black

for i in range(20): # for loop is for repeating no of blocks of shapes of circle with different for 20 times
t.left(30) # here we gave command to turtle pointer to turn 30 degree left
t.color("red") # this is command that specifies color to turtle which we gave red
t.circle(100,360) # here we made a circle with radius 100 and 360 is for full complete circle of 360 degree
t.left(30) # here we gave command to turtle pointer to turn 30 degree left
t.color("cyan") # we defined 2 nd color of turtle which is defined as cyan
t.circle(100,360,5) # again we made a circle but of 5 sides ,here 5 is no of sides
t.left(30) # here we gave command to turtle pointer to turn 30 degree left
t.color("pink") # we again defined color to turtle as pink
t.circle(100,360,6) # we made 3 rd circle now of 6 sides
t.left(30) # here we gave command to turtle pointer to turn 30 degree left
t.color("orange") # we again defined turtle color as orange
t.circle(100,360,10) # and now we made 4th circle of r = 100 , degree = 360 , and n.of sides = 10
t.left(30) # here we gave command to turtle pointer to turn 30 degree left

turtle.done() #we are stoping the turtle screen & or you can use turtle.getscreen()._root.mainloop()

guys if this code does'nt work then remove all t.
ex ;-t.color () remove t. from here