Teaching and learning Python bitwise operators gets much easier after showing the binary representations of integers using memory_graph:
bitwise operators: https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/bitwise_operators.py&breakpoints=22&continues=1&play
Understanding of the inverse `~` operator is helped by showing the two's complement representation: https://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html

