How would I round the answer so one decimal place would be displayed in the output? For example: If the radius were to be 8 the output would be 1005.3. As of right now it just displays 1005
import math
import sqrt
import math
def find_volume(radius, height):
return pi * radius * radius * height
def print_results (radius,height):
print 'Volume = '
def find_surface_area(radius, height):
return 2 * math.pi * radius * height + 2 * math.pi *
math.pow(radius,2)
def print_results (radius,height):
print 'Surface = '
def main():
radius = float(input("Enter value for a Radius: "))
height = float(input("Enter value for a Height: "))
print("Cylinder volume: %d" % (find_volume(radius, height)))
print("Cylinder surface area: %d" % (find_surface_area(radius,height))
if __name__ == "__main__":
main()