python and ...or ...

print(0 and 1 or 5) #5 and x and y  x为假 取x x为真 取y  or e or f  e为假 取f  e为真 取e
print(1 and 1 or 5) #1
print(2 and 0 or 5) #5
print(0 and 0 or 1) #1
print(1 and 1 or 0) #1
print(3 and 0 or 0) #0
print(0 and 1 or 0) #0

 

posted @ 2021-06-24 17:08  乔小生1221  阅读(19)  评论(0编辑  收藏  举报