how to get memory address of variable python code example Example: python get memory address of variable x = 4 print hex(id(x))