How to calculate the surface area of cylinder in Python

1 Answer

0 votes
import math 

radius = 6
height = 19
  
cylinder_surface_area1 = (2 * math.pi * radius * height) + (2 * math.pi * (radius * radius));
  
cylinder_surface_area2 = 2 * math.pi * radius * (radius + height);
  
print("Cylinder Surface Area = " + str(cylinder_surface_area1))
print("Cylinder Surface Area = " + str(cylinder_surface_area2))

 
 
 
  
  
  
'''
run:
  
Cylinder Surface Area = 942.4777960769379
Cylinder Surface Area = 942.4777960769379
  
'''

 



answered Jul 22, 2021 by avibootz

Related questions

1 answer 136 views
1 answer 129 views
1 answer 135 views
1 answer 164 views
1 answer 411 views
1 answer 183 views
1 answer 176 views
...