Are & and <and> equivalent in python? [duplicate]
问题 This question already has answers here : 'and' (boolean) vs '&' (bitwise) - Why difference in behavior with lists vs numpy arrays? (8 answers) Closed 5 years ago . Is there any difference in the logic or performance of using the word and vs. the & symbol in Python? 回答1: and is a Boolean operator. It treats both arguments as Boolean values, returning the first if it's falsy, otherwise the second. Note that if the first is falsy, then the second argument isn't even computed at all, which is