-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
你應該注意你收到了什麼錯誤信息。 –