Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # Andres Kwan
- import math
- try:
- r = float(raw_input('radius\n'))
- s = float(raw_input('lateral height\n'))
- except:
- print 'Enter a number!'
- exit()
- cone_surface = math.pi * r * s + math.pi * r ** 2
- base_area = math.pi * (r ** 2)
- cone_hight = math.sqrt(s ** 2 - r ** 2 )
- cone_volume = 1.0/3.0 * base_area * cone_hight
- #print 'surface of the cone: ' + str(surface)
- print 'surface of the cone: ', cone_surface
- print 'base_area: ', base_area
- print 'cone_hight: ', cone_hight
- print 'volume of the cone: ', cone_volume
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement