如果为空set()的False,不应该if test == False在下面的代码条款计算为True?
test = set()
# empty sets are false
if test == False:
print("set is empty")
else:
print("set NOT empty")
if not test:
print("set is empty")
Run Code Online (Sandbox Code Playgroud)
输出继电器:
set NOT empty
set is empty
Run Code Online (Sandbox Code Playgroud)