all or any 的用法 x = [True, True, False] if any(x): print("至少有一个True") if all(x): print("全是True") if any(x) and not all(x): print("至少一个True和一个False")