notExpert Playground

Logical NOT operator; inverts a boolean value

Python Playground
Output
Click "Run" to execute your code

'not' compiles to UNARY_NOT applied after evaluation. But 'is not' and 'not in' are single opcodes (IS_OP 1 and CONTAINS_OP 1) — they don't evaluate then negate, they do the negated comparison directly.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?