Write a program using Python turtle graphics which will ask the user for the radius of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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.) 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.)
Expert Answer:
Answer rating: 100% (QA)
Answer You can achieve this with Pythons Turtle module Heres a program that accomplishes what you de... View the full answer
Related Book For
Posted Date:
Students also viewed these operating system questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
What is the difference between MouseListener and MouseAdapter? [3 marks] (b) Via suitable HTML, the compiled version of the following Java code is presented to the appletviewer application: import...
-
What are the lessons of the 1997 Asian financial crisis? Were the IMF supported adjustment programs successful in their objective? Were there flaws in their design?
-
Bennett Inc. found that about 15% of its sales during the month were for cash. Bennett has the following accounts receivable payment experience: Percent paid in the month of sale...
-
This year Diane intends to file a married-joint return. Diane received $187,500 of salary and paid $5,000 of interest on loans used to pay qualified tuition costs for her dependent daughter, Deb....
-
In question 1, identify the marketing as opposed to the business strategy. Data From Question 1: What is a business strategy? Do you agree with the definition proposed? Illustrate your answer with...
-
Tribke Enterprises collected the following data from its financial reports for 20X3: Stock price ............. $18.37 Inventory balance .........$300,000 Expenses (excluding OGS) .... $1,120,000...
-
The index of refraction for a particular material is 1.38. Determine the speed of light in this medium. Light passes from water (n=1.33) into air (n=1.003) at an angle of incidence of 25 degrees....
-
1. Evaluate Theo's new strategy in light of the company's strengths, weaknesses, opportunities, and threats. 2. Using the BCG matrix, explain Theo's decision to offer a classic line of chocolate bars...
-
What is the major organic product obtained from the following reaction? 1. KCN 2. H*
-
In most public firms, although the executive management is in charge of running the business profitably, they are also the agents of the stockholders and they techinally work for the stockholders....
-
Operating activities include all except: Question 45 options: a decrease in accounts receivable. an increase in wages payable. the payment of dividends to shareholders. a decrease in accounts payable.
-
Simplify the rational expression. y2 3y-18 - 5y + 19y + 12
-
What is the purpose of sacrificial bonds? Question 4 options: break on impact to dissipate energy, preventing fracture form a scaffolding for mineral deposit hold the bone firm under all...
-
Net income must be adjusted for changes in current assets and liabilities, such as accounts receivable and accounts payable, when determining the net cash provided by: Question 36 options: equity...
-
What is the journal entry required when a township orders office supplies expected to cost $1000 (Government and not for profit accounting).
-
Planning: Creating an Audience Profile; Collaboration: Team Projects. Compare the Facebook pages of three companies in the same industry. Analyze the content on all available tabs. What can you...
-
Write code using the in operator that determines whether 'd' is in mystring.
-
You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You arent sure if any of them have dietary /restrictions, but...
-
Look at the following statement: levels = 'Beginner, Average, Advanced, Expert' Write a statement that splits this string, creating the following list: ['Beginner', 'Average', 'Advanced', 'Expert']
-
Mexico has labor laws that specify a daily (rather than hourly) minimum wage. In 2018, the daily minimum wage in Mexico was about 103 pesos per day, and the exchange rate between Mexican pesos and...
-
In 2017, an estimated 7.7 million Mexican-born immigrants were employed in the United States. a. If 60 percent of the Mexican-born immigrants remitted money to family members in Mexico in 2017, and...
-
A mathematical approximation called the rule of 70 tells us how long it will take for something to double in size if it grows at a constant rate. The doubling time is approximately equal to the...
Study smarter with the SolutionInn App