Code :
print(False == False) in [False]
print (False == (False in [False]))
print (False == False in [False])
Answer:
False
False
True
Solution and Explanation:
Let's go through each line:
print((False == False) in [False])
False == False is True.
The expression becomes True in [False].
Since True is not in the list [False], the final result is False.
The output for this line is False.
print(False == (False in [False]))
False in [False] is True.
The expression becomes False == True.
The output for this line is False.
print(False == False in [False])
This expression is equivalent to (False == False) and (False in [False]).
Both conditions are True.
The output for this line is True.
0 Comments:
Post a Comment