bitwise-operators-example/xor.py
2024-10-04 14:28:50 +01:00

10 lines
No EOL
206 B
Python

READ_PERMISSION = 4
WRITE_PERMISSION = 2
EXECUTE_PERMISSION = 1
userPermissions = READ_PERMISSION | WRITE_PERMISSION
userPermissions ^= WRITE_PERMISSION
print(userPermissions)
print(bin(userPermissions))