This is for Pycharm a python course. Can I get some help doing this and understand it?

import math
def main():
while(1):
print("Welcome to volume and
surface area calculator")
print("please choose one of the
following options")
print("1.volume of
sphere\n2.surface area of sphere\n3.volume of cylinder\n4.surface
area of cylinder\n5.volume of cone\n6.surface area of
cone\n7.exit\n")
ch = input("enter your
choice:\t")
if(ch==1):
r = input("enter
radius of sphere:\t")
sphereVolume(r)
elif(ch==2):
r = input("enter
radius of sphere:\t")
sphereSurface(r)
elif(ch==3):
r = input("enter
radius of cylinder:\t")
h = input("enter
height of cylinder:\t")
CylinderVoume(r,h)
elif(ch==4):
r = input("enter
radius of cylinder:\t")
h = input("enter
height of cylinder:\t")
CylinderSurface(r,h)
elif(ch==5):
r = input("enter
radius of cone:\t")
h = input("enter
height of cone:\t")
coneVolume(r,h)
elif(ch==6):
r = input("enter
radius of cone:\t")
h = input("enter
height of cone:\t")
coneSurface(r,h)
elif(ch==7):
print("Thank you
for using calculator")
break
else:
print("enter
correct option")
def sphereVolume(r):
volume = (4/3)*(math.pi)*(r*r*r)
print("volume of sphere is:\t"+str(volume))
def sphereSurface(r):
surface = 4*(math.pi)*(r*r)
print("surface area of sphere
is:\t"+str(surface))
def CylinderVoume(r,h):
volume = (math.pi)*(r*r)*h
print("volume of cylinder is:\t"+str(volume))
def CylinderSurface(r,h):
surface = (2*(math.pi)*r*h)+(2*(math.pi)*r*r)
print("surface area of cyclinder
is:\t"+str(surface))
def coneVolume(r,h):
volume = ((math.pi)*(r*r)*h)/3
print("volume of cone is:\t"+str(volume))
def coneSurface(r,h):
surface =
((math.pi)*r)*(r+(math.sqrt((h*h)+(r*r))))
print("surface area of cone is:\t"+str(surface))
main()


If you have any doubts please
comment and please don't dislike.
This is for Pycharm a python course. Can I get some help doing this and understand...
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...
Please do this in C language. Thank you
1. Write the following functions that compute the volume and surface of a sphere with radius r; a cylinder with circular base with radius r and height h; and a cone with circular base with radius r and height h. Place these functions in appropriate class. Define n (PI) as a constant variable equals to 3.14 then use it in the functions. float sphereVolume(float r) float sphereSurface(float r) float cylinderVolume(float r, float...
Need help writing this code in python.
This what I have so far.
def display_menu():
print("======================================================================")
print(" Baseball Team Manager")
print("MENU OPTIONS")
print("1 - Calculate batting average")
print("2 - Exit program")
print("=====================================================================")
def convert_bat():
option = int(input("Menu option: "))
while option!=2:
if option ==1:
print("Calculate batting average...")
num_at_bats = int(input("Enter official number of at bats:
"))
num_hits = int(input("Enter number of hits: "))
average = num_hits/num_at_bats
print("batting average: ", average)
elif option !=1 and option !=2:
print("Not a valid...
Can someone help me with this coding question. I cannot get this to run properly. Write a program that defines the named constant PI, const double PI = 3.14159;, which stores the value of π. The program should use PI and the functions listed in Table 6-1 to accomplish the following: Output the value of √π . Prompt the user to input the value of a double variable r, which stores the radius of a sphere. The program then outputs...
Please help me to do my assignment it should be python. Thank you Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses...
I'm trying to write a program that can ask a user about what type of solid they have and to be able to enter values like radius and length of the shape so the program can calculate the volume of a shape and print the result. I also want to give them a repeating option to input another shape if they want to. I'm trying to use at least 7 functions that can display an output, the volumes of a...
******** IN JAVA ********* I have a program that I need help debugging. This program should ask a user to input 3 dimensions of a rectangular block (length, width, and height), and then perform a volume and surface area calculation and display the results of both. It should only be done using local variables via methods and should have 4 methods: getInput, volBlock, saBlock, and display (should be void). I have most of it written here: import java.util.*; public class...
Hello, In Python Enhance the prior assignment by doing the following 1) Create a class that contain all prior functions MyLib # This function adds two numbers def addition(a, b): return a + b # This function subtracts two numbers def subtraction(a, b): return a - b # This function multiplies two numbers def multiplication(a, b): return a * b # This function divides two numbers # The ZeroDivisionError exception is raised when division or modulo by zero takes place...
Nay
programming languge is fine (MatLab, Octave, etc.)
This is the whole document this last picture i sent is the
first page
5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...
So I have a question in regards to my program. I'm learning to program in C and I was curious about the use of functions. We don't get into them in this class but I wanted to see how they work. Here is my program and I would like to create a function for each of my menu options. I created a function to display and read the menu and the option that is entered, but I would like to...