-3
print "Welcome to Dylan's Pythagorean Theorem Solver."
from math import sqrt
print "What are we solving for? A hypotenuse or a leg?"
ask = raw_input("# ")
if ask == "hypotenuse":
print "What is the value of your first leg?"
leg1 = raw_input("# ")
print "The value of your first leg is %s. What is the value of your second leg?" % (leg1)
leg2 = raw_input("# ")
print "The length of your hypotenuse is "sqrt((leg1 ** 2) + (leg2 ** 2))
当您尝试运行它时会发生什么? – xpda
你应该注意你收到了什么错误信息。 –