标签: python operators identity
为什么变量k和l的标识与变量i和j不同,而全都是数字?
i = 1 j = 1 k = 300 l = 300 print(i==j) print(k==l) print(i is j) print(k is l) print(id(i)) print(id(j)) print(id(k)) print(id(l))
True True True False 4464448848 4464448848 4504924080 4505563344