Dec-05-2022, 11:40 AM
Hi all. I came across a really weird error in python. I have tried updating to the latest version of python. When the following code is run, the result is python printing 'not equal'. The same happens when using integers. If the logic is changed to equal to (==) in both statements, it works correctly. I have also tried (is not).
status = 'inactive' if (status != 'inactive' or status != 'falsepos'): print('not equal') else: print('equal')