+ 1
How Can i Print The Location address Of a element of list?
such as Garbage Value u can call... the location address of a elwment
2 Antworten
+ 3
a = [i for i in range(10)]
print('a is here:', hex(id(a)))
for i in a:
print('a item:', i, 'is here:', hex(id(i)))
Pls note that the address of the list and its items may have little in common... :)
0
Thanks