What is the explanation for this behavior in Python?
a = 10
b = 20
a and b # 20
b and a # 10
a and b
evaluates to 20, while b and a
evaluates to 10. Are positive ints equivalent to True? Why does it evaluate to the second value? Because it is second?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…