Question

iIn python pleaseAutoSave H L04-3b Testing Lab - Protected View - Saved to this PC- Search A Jharrah375@outlook.com J 7 File Home Insert Draw

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

Example of input values are :

15.2

35.3

2)

formulas:

circle area: \prod * r^{2}

circumference: 2*\prod *r

Sphere area:4/3*\prod *r^{3}

Sphere surface area:4*\prod *r^{2}

3)

input code:

1602453895389_image.png

output:

: Enter a value: 10 2 23 Input Circle area Circle Circumference Sphere Volume Sphere surface area 10.00 314.16 62.83 4188.79

code:

import math
'''take user input'''
radius=input("Enter a value: ")
'''store into list'''
radius=list(radius.split(" "))
'''convert string to int'''
radius = [int(i) for i in radius]
'''print input'''
print("Input :{0:9.2f} {1:9.2f} {2:9.2f}".format(radius[0],radius[1],radius[2]))
'''print Circle area'''
print("Circle area :{0:9.2f} {1:9.2f} {2:9.2f}".format(math.pi*radius[0]*radius[0],math.pi*radius[1]*radius[1],math.pi*radius[2]*radius[2]))
'''print Circle Circumference'''
print("Circle Circumference :{0:9.2f} {1:9.2f} {2:9.2f}".format(2*math.pi*radius[0],2*math.pi*radius[1],2*math.pi*radius[2]))
'''print Sphere Volume'''
print("Sphere Volume :{0:9.2f} {1:9.2f} {2:9.2f}".format(math.pi*radius[0]*radius[0]*radius[0]*4/3,math.pi*radius[1]*radius[1]*radius[1]*4/3,math.pi*radius[2]*radius[2]*radius[2]*4/3))
'''print Sphere surface area'''
print("Sphere surface area :{0:9.2f} {1:9.2f} {2:9.2f}".format(4*math.pi*radius[0]*radius[0],4*math.pi*radius[1]*radius[1],4*math.pi*radius[2]*radius[2]))

Add a comment
Know the answer?
Add Answer to:
iIn python please AutoSave H L04-3b Testing Lab - Protected View - Saved to this PC-...
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
  • This is for Pycharm a python course. Can I get some help doing this and understand...

    This is for Pycharm a python course. Can I get some help doing this and understand it? ⑤ : ib tps://canvas.pasadena.edu/courses/1032754/assi a ☆ 西%N m Crowfall. Th O computing, with-c- O PHP Tutorial | SoloL ontoja. on tojav.. Write functions . def main) . def sphereVolume(r) . def sphereSurfacelr) def cylinderVolumetr. h) . def cylinderSurface(r, h) . def coneVolumefr, h) . def coneSurface(r, h) ences rations main() # call amin function at teh end In the main display, a menu...

  • Skills Needed: cin, cout, constants, arithmetic expressions, rounding, int main, meaningful variable names, spacing, indentation, documentation,...

    Skills Needed: cin, cout, constants, arithmetic expressions, rounding, int main, meaningful variable names, spacing, indentation, documentation, output. Computing Basic Geometric Formulas Write a program to compute answers to some basic geometry formulas. The program prompts the user to input a length (in centimeters) specified as a floating point value. The program then echoes the input and computes areas of squares and circles and the volume of a cube. For the squares, you will assume that the input length value is...

  • Using Python 3+ for Question P5.9 Instructions: Use one main() to call each of the functions...

    Using Python 3+ for Question P5.9 Instructions: Use one main() to call each of the functions you created. Only use one value of r and h for all the function. Ask the user for the r and h in the main() as an input, and h for all the functions. You should put the functions for areas in a separate file. ​ For example, firstDigtec7ze Write a function e digits n) (returning the number of digits in the argument returning...

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