【发布时间】:2021-08-12 15:22:12
【问题描述】:
我正在尝试将 if 函数与“and”一起使用。它不起作用 - 有没有更好的方法或更好的命令?这是我的代码示例:
if measure >= 4.52 and <= 4.58:
optimal += measure
total += measure
count += 1
elif measure >= 4.50 and <= 4.60:
allowed += measure
total += measure
count += 1
else:
faulty += measure
total += measure
count += 1
感谢您的帮助!
【问题讨论】:
-
已经有一个完美的答案。但是如果你想要
elif 4.60>=measure >= 4.50 and,你可以跳过and
标签: python if-statement