我正在尝试使用 python 制作测量机器,但是当我输入测量值时,它只是继续使用代码,我希望它在得到结果后停止处理,这是我到目前为止所做的代码:
print math.sqrt(int(h1)**2 + int(h2)**2)
我需要它在“ ”之后停止
need = raw_input("What do you need to Use?")
if need == "pythagoras" or "Pythagoras":
pythagoras = raw_input("What side do you Need?")
if pythagoras == "hypotenuse" or "Hypotenuse":
h1 = int(raw_input("Known Side 1"))
h2 = int(raw_input("Known Side 2"))
import math
print math.sqrt(int(h1)**2 + int(h2)**2)