Hello, I'm trying to create a program that calculates the hypotenuse and area of a right triangle.
I need to round the hypotenuse to 2 places after the decimal, and one place for the area
However, I can't seem to get it to work
If I tried
c = int(round(math.sqrt(a**2) + (b**2)), 2)
But I got this: TypeError: int() can't convert non-string with explicit base.
# This program computes right triangles
import math
print "This program computes the hypotenuse of a right triangle with the sides a and b."
a = input("Enter the length of the first leg to the nearest inch: ")
b = input("Enter the length of the second leg to the nearest inch: ")
# Calculate the length of the hypotenuse:
c = int(round(math.sqrt(a**2) + (b**2)))
# Calculate the area of the triangle
Area = int(round((a*b)/2))
# To create a line across:
print "-----------------------------------"
print "The hypotenuse is: ",c,"inches."
print "The area is: ", Area,"sq in."
Thanks!