+ 20
Why this is Falseâïžđ€
lst = ["a", True] print("a" in lst in lst)
6 Respostas
+ 15
It seems to work the same as :
print('a' in lst and lst in lst) âïž
+ 4
Janusz Bujak đ”đ± this is what youre after
print(("a" in lst)in lst)
â(âaâ in lst)â evaluates True FIRST then tests for âTrue in lstâ which returns True.
+ 2
Use : print("a" in lst)
+ 1
Not sure if this help to explain but ..
lst = [1, True, 'a']
lst2 = [[1, True, 'a'], [1, 2], [3, 4], [5, 6]]
print('a' in lst in lst2) ### returns True
+ 1
That's exactly how it works, Janusz Bujak đ”đ±.
0
because,you used in print"a" which is an element. But you should use in print(1st,"in 1st in list")