x or y.若X为真返回X

优先级  ()>not>and>or

x or y.若X为真返回X,X为假则返回Y

print(1 or 2)   #1

print(0 or 2)  #2

x and y 与 or 相返

print(1 and 2)   #2

print(0 and 2)  #0

print(1>2 and 3 or 4 and 3<2) # flase

print(2 or 1<3)                        #2

print(2 or 1<3 and 2)              #2

猜你喜欢

转载自www.cnblogs.com/ychihior/p/10798911.html
x