标签:分割 逻辑 === 原则 计算 == not 返回 布尔值
print(True and 10 > 3 and not 4 < 3 and 1 == 1)
print(False or 10 < 3 or not 4 < 3 or 1 == 1)
res=(10 == 9 and 0 < 3) or ('' == 'egon' and 0> 3) or not True or ('egon' == 'dsb' and 333 > 100) or 10 > 4
print(res)
if 0:
print('ok')
else:
print('=====>')
if 3 and []:
print('真')
else:
print('假')
res=0 and 123
res=111 and 123
print(res)
if 111 and 123:
print('ok')
else:
print('no')
x=''
if x:
print('不为空')
else:
print("为空")
print(1 or 0) # 1
print(0 and 2 or 1) # 1
print(0 and 2 or 1 or 4) # 1
标签:分割 逻辑 === 原则 计算 == not 返回 布尔值
原文地址:https://www.cnblogs.com/xuexianqi/p/12349485.html