Bitwise Operators (&, |, ^, ~, ) Dry Run in PYTHON

Bitwise Operators (&, |, ^, ~, ) is an interactive PYTHON dry run visualizer from the Io programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Bitwise Operators (&, |, ^, ~, ) Program Code

# Demonstrating bitwise operators
a, b = 8, 9

print(f"Binary of {a}: {bin(a)}")
print(f"Binary of {b}: {bin(b)}")
print(f"\n{a} & {b} = {a & b} (AND)")
print(f"{a} | {b} = {a | b} (OR)")
print(f"{a} ^ {b} = {a ^ b} (XOR)")
print(f"~{a} = {~a} (NOT)")
print(f"{a} << 2 = {a << 2} (Left Shift)")
print(f"{a} >> 2 = {a >> 2} (Right Shift)")

View the complete Io programs page.

Program Console Bitwise Operators (&, |, ^, ~, ) Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.