Quick actions

cmd+k|ctrl+k

Navigation

Languages

RamLocation

Snippet info

Language

Python

Visibility

public

Author

fai

Created

2024-08-02T04:58:17.612141Z

Updated

2024-08-03T19:02:32.979933Z

x = 1
print(x, id(x))
y = 1 
print(y, id(y))

# the address of x and y is the same, 132311328085192 is stored somewhere inside Ram.
# the value of x and y points to the location of 1 is situated at 132311328085192.
# whenever we run the program, the address of 1 will be changed inside Ram.

# if x is changed to 1.0 and y is kept at 1, the location at x and y is different at Ram.
INFO