Learn Python in 7 Days
上QQ阅读APP看书,第一时间看更新

Logical operators

Python supports logical operators AND, OR, and NOT:

These only evaluate their second argument if needed for their outcome, as shown in the following screenshot: