I am trying to check if two python objects have same memory address
I am trying to do somthing like a == b
. but its not working.
I am trying to check if two python objects have same memory address
I am trying to do somthing like a == b
. but its not working.
you can use id to know if they refere to the same object.
a= 5
b= 4+1
print (id(a))
print (id(b))
Compare if two variables reference the same object in python
How do I check if two variables reference the same object in Python?