shift operator, ternary operator / conditional operator in python
DEV · 16.11.2026 · 21:23
print(4 >> 1) → 2 print(4 << 1) → 8 print(4 << 2) → 16 print(4 << 3) → 32 Left Shift: << Right Shift: >>. The ternary operator is a short way of writing an if-else condition in a single…