a = 1 b = 1 print(a is b) # True
# True a = "good" b = "good" print(a is b) # False a = "very good morning" b = "very good morning" print(a is b) # False a = [] b = [] print(a is b)
本文首发于python黑洞网,博客园同步更新