Question
Below it the code for the Labs 1-3 makeup. Please code in python import turtle #Taking input from the user n=input(Enter the number of sides
Below it the code for the Labs 1-3 makeup. Please code in python
import turtle #Taking input from the user n=input("Enter the number of sides of polygon:"); n=(int)(n) if(n>=3 and n
andrew.shape("turtle") # alex looks like a turtle #calculating angle angle=360 andrew.color("green") i=1 while(i Create a program that will modify Labs 1-3 makeup to contain three functions (one main and two other functions) The main function will contain input and calls to your other functions You should create value-returning function to robustly confirm that the user's input is between 3 and 12 inclusive. This function should accept 1 parameter and return 1 value that is between 3 and 12 inclusive The other function is void function that accepts one parameter for the number of sides of the polygon and will use a for loop to output the polygon. This function should contain all the turtle commands. Nothing should be returned to the function call from this function. Your main function should prompt the user to enter a value between 3 and 12 for the number of sides of the polygon. Next your main function should call the function to check the input. Finally your main function should call the function to draw the polygon. Import turtle before all your programmer built functions Do not use the same variable name in multiple functions. Remember to write introductory for the entire program at the very beginning of your program. Also write comments for the function to check input and to draw the polygon immediately before these functions. Refer to the demo programs as examples. You do not have to write special comments for the main function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started