False in [False, True]
= True
Why?
not(True) in [False, True]
= False
Is it?
not(True)
is False
?
This is because of the priority of the operator.
This is because in
has a higher priority than not
.
(not True) in [False, True]
I think you thought it was handled in the same way as
in reality
not (True in [False, True])
Because it's processed in the same way.
Also, not
is not a function, so it is not recommended to use it with not()
.
© 2024 OneMinuteCode. All rights reserved.