+ 2
What is the output? How does it work mechanism? For Your Information:
A =["a", "b", True, "c", False] print("a" in arr) # return True print(("a" in arr) in arr # return true print((Bool(None) in arr) in arr # return True # since it works based on the presence of () which give a priority to the sequence of arithmetic operation to conduct.
3 Respuestas
+ 5
Let's start Oliver Pasaribu . with there is either no A array or no arr array so let's correct this as
arr =["a", "b", True, "c", False]
print("a" in arr) # return True
print(("a" in arr) in arr ) # return True
print((bool(None) in arr) in arr )
# return True
Is 'a' in the array yes ( True )
Is 'a' in the array yes True and is True in the arr -> the answer is yes ( True )
bool(None) expression evaluates to False and yes False is in the array so True and is True in the array yes so the answer is True
In conclusion all 3 statements are True
+ 3
Oliver Pasaribu ,
what exactly is your question?
+ 2
Yes. You right Brofar. We are thinking on the same way.