Description
Write a Python program that creates any regular polygon. The number of sides of the polygon and the color of the fill should be entered by the user. After the user provides those values, the turtle should draw the shape, fill it with the color entered, and disappear from the graphics window.
The program should then ask the user if they want to draw another shape. If the user enters “yes”, the program repeats the process of asking for the input values and re-drawing the shape. This process will repeat until the user enters anything other than “yes”.
Before drawing the additional shape, the turtle should erase the current shape being displayed and go back to home.
The program must do input validation to check that the number of sides is at least 3. The program should continue to ask them to re-enter the number of sides until a valid input is given.
Hint: To get the angle in degrees for the shape, use the formula degrees = n * 360, with n being the number of sides of the polygon. Also, for the length of the sides, simply use a constant like 100.
A sample output is shown below.
Dan Lockhart –
Excellent, thank you! Got solution extremely fast, within minutes.
Michael Jones –
Thank for your help and service. I really like the work that they did on my paper.
Miles Mawby –
I am glad I got assistance, I’m am very happy with the service.
Tangela Arnwine –
great and amazing work, highly recommend. God bless you in all your days 🙂
Stephanie Specht –
Tutor is patient, highly efficient and well spoken. I can always count on early delivery! Thx!!
Sabrina Turner –
The assignments I submit are always of great quality and completed on time.