python is和==的区别

# ==和is

# ==用来判断值是否相等
# is是用看来判断是不是指定了同一个东西,判断是不是指向了同一个地址等

a = [11,22,33]
b = [11,22,33]

a == b # True
a is b # False

print(id(a))              
print(id(b))

c = a
print(id(c))

print(a is c)

a = 100

b = 100

print(a == b)
print(a is b)
print("===============")
a = 100000000
b = 100000000
print(a == b)
print(a is b)

上一篇:Jenkins触发远程Job的几种方式


下一篇:【java】之类加载机制