# 对于None,False,空字符串,0,空列表,空元组,空字典,都等于False
a=None
b=False
c= ""
d =[]
e=()
f ={}
print(bool(a),bool(b),bool(c),bool(d),bool(e),bool(f)) # 这些都返回:
>>False False False False False False
print(bool(not a),bool(not b),bool(not c),bool(not d),bool(not e),bool(not f)) # not 即“不是”,not False 就理解为 True:这里都返回
>>True
s=""
s1="1"
print(id(s1))
print((id (s)))
print(s is not s1) # is是用来判断id是否相等,这里可以理解为:s 的id 不等于s1的id 就位True
print(s is s1) # 这里就是单纯的判断id 是否相等
>>
52753696
25631456
True
False