Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle, Screen
- import math
- def draw_petal(turtle, radius, size):
- heading = turtle.heading()
- turtle.circle(radius, size)
- turtle.left(180 - size)
- turtle.circle(radius, size)
- turtle.setheading(heading)
- def draw_petalDown():
- leafSize = 60
- for _ in range(2):
- draw_petal(bob, 70, size=leafSize)
- bob.left(180 - leafSize)
- def draw_stonka(b, radius):
- c=2*math.pi*radius
- ca=c/(360/60)
- n=int(ca/6)+1
- l=ca/n
- for i in range(n):
- b.fd(l)
- b.lt(360/(n*6))
- my_radius = int(input("Aky je radius kvietka? "))
- my_lupienky = int(input("Kolko lupienok? "))
- bob = Turtle()
- for _ in range(my_lupienky):
- draw_petal(bob, my_radius, size=60)
- bob.left(360 / my_lupienky)
- bob.seth(240)
- draw_stonka(bob, my_radius*2)
- bob.setheading(0)
- draw_petalDown()
- bob.hideturtle()
- screen = Screen()
- screen.exitonclick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement