The task: check if 'value' is in list_1 AND list_2
Approach below - is the result of 2 minutes intuitive playing
list_1 = ['3', '5']
list_2 = ['5', '7', '4']
r = '5' in (list_1 and list_2) # 'and' gets an intersection
print(r) #True
And it works in a way I expect. I've already seen solution like that - it works, but there is a little room of my misunderstanding, that's why I ask
(1) Can't find docs, describing how 'and' operator (should)works, for list, dicts, tuples etc.
(2) Why the following code returns 'False'
list_1 = ['3', '5']
list_2 = ['5', '7', '4']
r = '5' in (list_1, list_2) # Tuple?
print(r) #False
(3) Why it returns ['5', '7', '4']
list_1 = ['3', '5']
list_2 = ['5', '7', '4']
r = '5' in list_1 and list_2
print(r) # ['5', '7', '4']
(4) Why it returns (True, ['5', '7', '4'])
list_1 = ['3', '5']
list_2 = ['5', '7', '4']
r = '5' in list_1, list_2
print(r) # (True, ['5', '7', '4'])
I believe there is some doc at python docs web site, which enlightens questions above. It is possible to spend some time learning python 3 source code to see implementation details, but I am wondering of some language standart(like ECMAScript) which was used when Python 3 implementing