Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* DO NOT HARDCODE PRNT STATEMENTS* Variable Assignment and Variable Naming Conventions Using a Python script run on the command line, calculate the diameter and

image text in transcribed

* DO NOT HARDCODE PRNT STATEMENTS*

Variable Assignment and Variable Naming Conventions Using a Python script run on the command line, calculate the diameter and area of a circle with a radius of 3. In this activity, we'll get better acquainted with variable assignment as well as variable naming conventions. Here are some hints: The formula for calculating diameter is 2 * r. The formula for calculating area is * r^2, r being the radius. can be approximated to 3.14159. Steps for Completion 1. Open the main.py file in your editor. 2. On the first two lines, declare your constant, (PI), and the radius of the circle with a value of 3 3. Write the lines to run your calculations. 4. Display the results by using print statements. 5. Run the script by using the python3 main.py command. The output should look like Figure 1.9. > Terminal + workspace $ python3 main.py Diameter of the circle: 6 Area of the circle: 28.27431 workspace $

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

the importance of word of mouth in the promotional mix.

Answered: 1 week ago