A regular polygon is a shape that is both equilateral (all sides have the same length) and equiangular (all inner angles are the same). In this exercise, we’ll draw these programmatically!
Using the turtle library, draw a square where each side is 50 pixels long. Use a for loop to avoid code repetition. Each iteration of the for loop should draw one side of the square.
Ask the user for a number of sides, and based on the number given, have your program draw any shape. Hint: the image below intuitively shows the relationship between the number of sides and the outer angle of rotation.
clear()to erase everything that has been drawn between shapes.