我有点疯了。我不明白这笔交易。你知道吗
这样做有效:
a=5
if a>2 & a<7:
print('Good')
这也适用于:
a=5.
if a>2:
print('Good')
但这行不通。你知道吗
a=5.
if a>2 & a<7:
print('Good')
我得到一个错误,告诉我它不支持浮动值。你知道吗
TypeError Traceback (most recent call last)
<ipython-input-550-e437dc6fe8a9> in <module>()
1 a=5.
----> 2 if a>2 & a<7:
3 print('Good')
TypeError: unsupported operand type(s) for &: 'int' and 'float'
怎么回事?错误消息并没有真正告诉我如何处理浮动值,这就是我的数据库中的内容。看起来&
是有问题的,因为一个条件可以处理浮点值。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐