+ 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

6th Apr 2017, 5:31 AM
Rakib
Rakib - avatar
2 Respostas
+ 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... :)
6th Apr 2017, 6:31 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
Thanks
6th Apr 2017, 6:52 AM
Rakib
Rakib - avatar