德摩根定律

可用于条件语句中
在这里插入图片描述
判断 均有 or 均无

(bool(a and b and c) or not bool(a or b or c))

# 均无的话是true
not bool(a or b or c) == not(bool(a)) and not(bool(b)) and not(bool(c))

猜你喜欢

转载自blog.csdn.net/qq_42648305/article/details/111922736