逻辑运算符
'''x or y x True,则返回x''' # print(1 or 2) # 1 # print(3 or 2) # 3 # print(0 or 2) # 2 # print(0 or 100) # 100 # print(2 or 100 or 3 or 4) # 2 # print(0 or 4 and 3 or 2) '''x and y x True,则返回y''' # print(1 and 2) # print(0 and 2) print(2 or 1 < 3) #2 print(3 > 1 or 2 and 2) #true
# print(5 < 4 or 3) #3
# print(2 > 1 or 6) #true
# print(3 > 1 and 0) #False
# print( 0 and 3 > 1) #0

浙公网安备 33010602011771号