Permission-Flags Calculator
Real Unix file permissions (the ones behind chmod) work exactly like this: read=4, write=2, execute=1, combined and checked with bitwise operators.
Example run
Output
=== Permission Report ===
Permissions value: 6
Binary: 0b110
Can read: True
Can write: True
Can execute: False
How to run
Download
starter.py below and run python3 starter.py.
Ideas to make it your own
- Combine all three flags (read + write + execute) and confirm the binary output is
0b111. - Try removing a flag using
&with~EXECUTE(the bitwise complement). - Look up what
chmod 644andchmod 755mean on a real Unix system — you'll recognize the exact math you just wrote.
Why this project matters
This is not a toy exercise — it's the literal mechanism used by real operating systems, database permission systems, and feature-flag systems in production software.