Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- t=Turtle()
- answer=input("choose which shape to draw: circle, polygon or star")
- if answer=="circle":
- radius=int(input("Enter radius of circle"))
- t.circle(radius)
- elif answer=="polygon":
- sides=int(input("How many sides do you want in polygon"))
- length=int(input("What length should each side be"))
- angle=360/sides
- for i in range(sides):
- t.forward(length)
- t.right(angle)
- elif answer=="star":
- sides=int(input("How many sides do you want in star"))
- length=int(input("What length should each side be"))
- angle=180-(180/sides)
- for i in range(sides):
- t.forward(length)
- t.right(angle)
- else:
- print("invalid input")
- done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement