Tuesday, March 11, 2025

Python program for Calculate area & circumference of Circle, area of Cylinder & volume of Cylinder, Sphere Volume

 10. Python program for Calculate area and circumference of Circle. r=5


r = 5

pi = 3.14

area=r*r*pi

circumference = 2 * r * pi

print("The Area is ", area) # The Area is 78.5

print("The Circumference is ", circumference) # The Circumference is 31.400000000000002





import math

r = 5

area=r*r*math.pi
circumference = 2 * r * math.pi
print("The Area is ", area ) # The Area is  78.53981633974483
print("The Circumference is ", circumference) # The Circumference is  31.41592653589793




11. Python program for Calculate area of Cylinder. r=9.7, h=5.3 area=2x3.14rh and  volume   of Cylinder

pi = 3.14
r=9.7
h=5.3 
area=2*pi*r*h 
volume=pi*r*r*h
print("The Area is ", area ) # The Area is   322.85479999999995
print("The Volume is ", volume ) # The Volume is 1565.8457799999999




import math

r=9.7
h=5.3 
area=2*math.pi*r*h 
volume=math.pi*r*r*h
print("The Area is ", area ) # The Area is 323.0185566421025
print("The Volume is ", volume ) # The Volume is 1566.639999714197




12. Python program for Sphere Volume 4/3.0 pirrr    r=8.3  

pi = 3.14
r=8.3
volume=pi*r*r*r
print("The Volume is ", volume ) # The Volume is 1795.4111800000007



import math
r=8.3
volume=math.pi*r*r*r
print("The Volume is ", volume ) # The Volume is 1796.3218386181475





No comments:

Post a Comment

How to Calculate Net salary in Python

  13. bpay=4560, Calculate da=16%, hra=12%, oa=8%,it=3%, & net basicpay=4560 da=basicpay*0.16 hra=basicpay*0.12 oa=basicpay*0.08 it=basi...