[Tutor] What is wrong my code?

Hoffmann oasf2004 at yahoo.com
Fri Mar 24 22:02:45 CET 2006


Could anyone, please, let me know what is wrong with
my code (shown below)? I am getting a runtime error.
ps: The code:


import math

print '''This program calculates the lenght of the
hypotenuse of a right triangle
    given the lenghts of the two legs as
leg1 = raw_input('Enter the first leg of the triangle:
leg2 = raw_input('Enter the second leg of the
triangle: ')

result = hypotenuse(leg1, leg2)

print 'The hypotenuse of the triangle is', result
def hypotenuse(x,  y):
    result = math.sqrt(x**2 + y**2)
    return result

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Tutor mailing list