python 中 灵活的and/or

# 当前面为真,才会进行后面的运算
b = True and 3
# 当前面为假,后面就不会运算了
# b = False and 3

# 当前面的值为真,后面就不需要了
# a = True or 5
# 当前面的值为假,才会进行后面的运算
a = False or 5

猜你喜欢

转载自blog.csdn.net/qq_42467563/article/details/82949731