Question: Write a program using Python turtle graphics which will ask the user for the radius of a circle, then draw the circle centered on
Write a program using Python turtle graphics which will ask the user for the radius of a circle, then draw the circle centered on the screen. The idea of this is that when a regular polygon has many sides, it looks like a circle. So you want to set up a for loop which executes a large number of times, say x. Then, as you draw each side of the polygon, you want to turn 360 1 x each time and go forward (2*pi*r) / x each time. Be careful in your formula for calculating x, which will be based on the size of the radius the user enters. If you calculate x so large that you are only going forward by 0.25 pixels each time, it's not going to work very well. You should calculate x so that you are going forward by more than 1 pixel each time. The variable x will need to be an integer because it is used in the for loop. (Don't worry about being perfect.)
Step by Step Solution
3.53 Rating (150 Votes )
There are 3 Steps involved in it
Answer You can achieve this with Pythons Turtle module Heres a program that accomplishes what you de... View full answer
Get step-by-step solutions from verified subject matter experts
