Skip to content
Advertisement

Tag: equality

Python if not == vs if !=

What is the difference between these two lines of code: and Is one more efficient than the other? Would it be better to use Answer Using dis to look at the bytecode generated for the two versions: not == != The latter has fewer operations, and is therefore likely to be slightly more efficient. It was pointed out in the

Advertisement