【发布时间】:2017-10-06 15:41:20
【问题描述】:
它说错误是当 h(高度)在 11000 和 25000 之间时,所以我只在我的所有 if 循环和发生问题的特定循环之外发布了初始内容。这是我的代码:
import math;
T = 0.0;
P = 0.0;
hString = ("What is the altitude in meters?");
h = int(hString);
e = math.exp(0.000157*h);
elif 11000 < h < 25000:
T = -56.46;
P = (22.65)*[(1.73)-e];
【问题讨论】:
-
你的代码给了我
ValueError: invalid literal for int() with base 10: 'What is the altitude in meters?'。您能否更正您的代码示例,使其在复制粘贴到 Python 控制台时运行? -
请发布实际产生您报告的错误的代码。这个关于写MVCE 的页面可能会有所帮助。
标签: python-3.x math