[Solved] Wondering how id() function works!? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

[Solved] Wondering how id() function works!?

Why on earth this code returns "True" and these objects have the same id? print(id([['1'],['2']])) print(id(['abc','def'])) print(id([['1'],['2']]) == id(['abc','def']))

21st Mar 2022, 6:05 PM
Siavash Kardar Tehran
Siavash Kardar Tehran - avatar
1 Answer
+ 9
Ids play with objects not with expressions. https://code.sololearn.com/cjsc0lBa578b/?ref=app
21st Mar 2022, 6:23 PM
Oma Falk
Oma Falk - avatar