I just started to learn python few days ago. This is a small program I made to practise.
print("Find Volumes of some Popular Solids")
print("")
names=['(1) Sphere','(2) Right Circular Cone','(3) Cylinder']
x=0
while x < 3:
print(names[x])
x +=1
print('\n' + 'Enter the number of the solid, you want to check the volume and press ENTER')
solid=int(input('Number : ' ))
print('\n'+'You have selected : ', (names[solid]))
x = 22/7
if solid == 1 :
R=int(input('\n'+"Enter value for r : "))
V=float((4*(22/7)*R) / 3)
H=0
elif solid == 2 :
R=int(input('\n'+"Enter value for r : "))
H=int(input("Enter value for h : "))
V = float((x) *(R*R) * H) * (1/3)
elif solid ==3 :
R=int(input('\n'+"Enter value for r : "))
H=int(input("Enter value for h : "))
V = float((22/7)*(R*R)*H)
else :
print("Entered value is wrong")
R=str(R)
H=str(H)
V=str(V)
print('\n'+"h = " + H + " r = " + R)
print("Volume is : "+ V + '\n'+ '\n')
input("Press ENTER key to exit the program")