[英]How do I determine a column is equal to zero when it's not supposed to be
How can I write in python if/else statement for if column A value ranges between 5 and 15, then column B should not be equal to 0?如果列 A 的值介于 5 和 15 之间,那么如何在 python 中编写 if/else 语句,那么列 B 不应该等于 0?
if (5 < columnA < 15):
if b != 0:
return True
else:
return False
else:
return True
This will check if columnA
is in the range, if it's not, b
doesn't matter and will return True
.这将检查columnA
是否在范围内,如果不在范围内, b
无关紧要并返回True
。
If columnA
is in the range, will check if b
is 0
.如果columnA
在范围内,将检查b
是否为0
。 If it's 0
will return False
, if b
it's not 0
, it will return True
如果是0
会返回False
,如果b
不是0
会返回True
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.