New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Why output of this code is 'false'?
x = [ 1,3,5 ] print (x in x)
4 Answers
+ 5
Because the list is not a member of itself, only elements inside are members of the list.
+ 2
[not answer] [off-topic]
Hari Shankar As continuation of Alexandr's example check this out.
https://code.sololearn.com/cC6sIz1KO4ax/?ref=app
+ 1
x = [1, 3, 5]
x.append(x)
print(x in x)
Output of this is true