[Tutor] Strange results when using not operation.

Magnus Myrefors myrefors.magnus at telia.com
Fri Apr 21 10:26:30 EDT 2023


Hello !

I am currently Reading a ”Beginning Python” book, and when I did some tests with the not operation in the IDLE python Shell I saw som strange results. When I typed   ’ not”A”  == False ’ the result was ’True’ and when I typed ’ not”A” == True ’ the result was ’True’ again. I got similar results when I typed ’ not(2) == False ’ and   ’ not(2) == True ’  which both gave the result ’True’ . When I put the whole left side in paranthesis like this: ’ (not”A”) == False’ and  ’ (not”A”) == True ’ the results were different.

Magnus

Skickades från E-post för Windows



More information about the Tutor mailing list