Question

Use Python 3, please type. Include the recommended comments at the top of your code with...

Use Python 3, please type.

Include the recommended comments at the top of your code with one test run.

Calculate the area of a circle for each radius value from 100 to 500 in steps of 25

example:

for i in range(1,11,3):

print(i)

The formula for area of a circle is pi * radius * radius

use 3.142 for pi

The output should look like this:

radius area

100 ?

125 ?

...

500 ?

Note, this program will output the area to 2 decimal places.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
print("radius\t area")
for r in range(100,501,25):
    print(r,"\t",(3.142*r*r))

Add a comment
Know the answer?
Add Answer to:
Use Python 3, please type. Include the recommended comments at the top of your code with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • given code: assignment: use python to extend the given code to create an output similar to...

    given code: assignment: use python to extend the given code to create an output similar to the one in the black box please explain the final code import random HALMst N in = int(input('Enter Total Number of Cards: ") NM in NOON A = [] B [] E - [] D = [] E = [] for i in range(1, n+1): A.append(i) D.append(i) E.append(i) for j in range(n): 8.append(random.choice(D)) D.remove(B[5]) C.append(random.choice(E)) E.remove(C[j]) c= 0 for k in range(n): if (Brkl...cikl):...

  • Part 1: Python code; rewrite this code in C#, run the program and submit - include...

    Part 1: Python code; rewrite this code in C#, run the program and submit - include comments number= 4 guesscount=0 guess=int(input("Guess a number between 1 and 10: ")) while guess!=number: guesscount=guesscount+1 if guess<number: print("Your guess is too low") elif guess>number: print("Your guess is too high") else: print("You got it!!") guess=int(input("Guess again: ")) print("You figured it out in ",guesscount," guesses") Part 2: C++ code; rewrite the following code in C#. Run the program and submit. - include comments #include <iostream> using...

  • Geometric calclator use python to do this program. Write a program that displays the following menu:...

    Geometric calclator use python to do this program. Write a program that displays the following menu: 1. Calculate the area of circle 2. calculate the area of rectangle 3. calculate the area of triangle 4. Quit Enter your choice (1-4). if the user enters 1, your program should ask for the radius of the circle and then display its area. Use the formula to calculate the circle's area: Area = pi*r^2 Use 3.14149 for Pi and the radius of the...

  • I need help with this python programming exercise, please! thanks in advance Create a Python script...

    I need help with this python programming exercise, please! thanks in advance Create a Python script file called hw4.py. Add your name at the top as a comment, along with the class name and date. Both exercises should be in this file, with a comment before each of them to mark it. Ex. 1. Write a program that inputs an integer number from the user, then prints a letter "O" in ASCII art using a width of 5 and the...

  • Use python 2.7 to write this code: This code takes in a bunch of protein sequences...

    Use python 2.7 to write this code: This code takes in a bunch of protein sequences as input listed below and tracks the highest average TM value (number under each protein) and If a protein has the highest TM value of all proteins found so far, track it. At the very end, the program should print out that as well: For example, at the very end when run, it should print something like this: Protein with the highest TM value:...

  • Instructions circle.py + >- Terminal 1 # Put your code here 2 Write and test a...

    Instructions circle.py + >- Terminal 1 # Put your code here 2 Write and test a program that computes the area of a circle. 1. Request a number representing a radius as input from the user 2. Use the formula 3.14 radius? to compute the area. 3. Output this result with a suitable label An example of the program input and output is shown below: Enter the radius: 5 The area is 78.5 square units

  • Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The...

    Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...

  • *Note: Include the following set of comments at the top of your source code for all assignments A...

    *Note: Include the following set of comments at the top of your source code for all assignments A small private elementary school would like to hire you to write a C++ program that stores students’ emergency phone numbers for school purposes. The students’ are required to provide the school with 3 phone numbers in case of an emergency. a. Phone: Specify a structure named Phone to store the area code (ex. 501), prefix (ex. 336), and last four digits of...

  • 1 Show the output from the following Python code fragment: for i in [ 12, 4,...

    1 Show the output from the following Python code fragment: for i in [ 12, 4, -2]:      print (2 * i) 2 Write a Python program findAverage to find the average of the numbers in a range defined by two inputs num1 and num2, where the values of num1 and num2 are entered by the user. For example, a call to findAverage(2,10) would find the average of the numbers 2,3,4,5,6,7,8,9 (note the final "10" is NOT included!). The output...

  • in python would you please help me to keep this code as in a simple and...

    in python would you please help me to keep this code as in a simple and easy code to follow please I want the code to run like first line of the letters ['B', 'C', 'D', 'BC', 'CB', 'BD', 'BCB', 'CBD', 'BCBD'] ['B', 'BC', 'BCB', 'BCBD', 'C', 'CB', 'CBD', 'BD', 'D'] word="BCBD" lst=[] for i in range(len(word)): for j in range(i+1,len(word)+1): if word [i:j] not in lst: lst.append(word[i:j]) print(lst)

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT