Saturday, October 1, 2011

Test 0004: solving for a hypotenuse

#October 1, 2011
#Python 3.2 code by Carla Fuqua
#purpose: to allow a user to solve for a hypotenuse

#ask for values and assign to integers floats
w=float(input("Enter the width: "))
h=float(input("Enter the height: "))

#Pythagorean Theorem
hyp=(w*w+h*h)**(0.5)

#show hypotenuse
print('The hypotenuse is:',hyp)

#sweet!