Program
Program
def sphere():
r=float(input('Enter the radius:-'))
vol=4/3*pi*(pow(r,3))
s_area=4*pi*(pow(r,2))
def cylinder():
r=float(input('Enter the radius:-'))
h=float(input('Enter the height:-'))
l_area=2*pi*r*h
t_area=2*pi*r*h+2*pi*(r**2)
vol=pi*(pow(r,2))*h
def cube():
s=int(input("Enter side of cube:-"))
t_area=6*s**2
vol=s**3
print('To print total surface area and volume of sphere. Enter 1')
print('To print total surface area, lateral surface area and volume of cylinder.
Enter 2')
print('To print surface area and volume of cube. Enter 3')
ent=int(input('Enter:-'))
if ent==1:
print(sphere())
elif ent==2:
print(cylinder())
elif ent==3:
print(cube())
#OUTPUT
import math
def Add(a,b):
Sum=a+b
return Sum
def Subtract(a,b):
difference=a-b
return difference
def Multiply(a,b):
product=a*b
return product
def Divide(a,b):
quotient=a/b
return quotient
def squ(a):
sqre=a**2
return sqre
def sqrot(a):
sqroot= math.sqrt(a)
return sqroot
if a==1:
print("Sum of the numbers",Add(n1,n2))
elif a==2:
print("difference of the numbers",Subtract(n1,n2))
elif a==3:
print("product of the numbers",Multiply(n1,n2))
elif a==4:
print("Dividing of the numbers",Divide(n1,n2))
elif a==5:
print("Finding the Square",n1**2)
elif a==6:
print("The square root of the number is:-",sqrot(n1))
else:
print("invalid choice")
#OUTPUT