identity operator

#identity operator

a= 20
b= 20
print ("line1", "a=", a, " : ", id(a), "b=", b, ":", id(b))

if (a is b):
print("line 2 - a and b have same identity")
else:
print ("line 2 - a and b do not have same identity")

if (id(a) == id(b)):
print ("line 3 - a and b have same identitiy")
else:
print ("line 3 - a and b do not have same identity")

b= 30
print ("line 4", "a=", a, ":", id(a), "b=", b, ":", id(b))

if (a is not b):
print("line 5 - a and b do not have same identity")
else:
print("line 5 - a and b have same identity")

Comments

Popular posts from this blog

WD&D (DNS)

kclothings.org

WDD-LO1-server