I am not a programming genius, but just in the beginning of this year, when being taught propositional logic my teacher told me (and it was quite obvious) that if P is True, not(P) or ~P was False, and the opposite if P was False.
Reading the Python docs about creating custom objects, I found that they claim that a==b
being True
does not imply that a!=b
is False
. This confused my mind as I thought that !=
was the negation of ==
and therefore, whenever evaluating with ==
returned a boolean result, the expression !=
would always evaluate to the opposite... And as far as I know, not(True)
evaluates to False
and not(False)
evaluates to True
. Can someone please help me understand how this happens? Perhaps with an example?
I read about this right here
quoting:
The truth of x==y does not imply that x!=y is false.