String comparison gives strange results

45 Views Asked by At

Why after concatination result changed?

b = "test"+str(1)
a = "test"+str(1)
print(a is b) # False

b2 = "test"+"1"
a2 = "test"+"1"
print(a2 is b2) # True ???

0

There are 0 best solutions below