Code Explanation:
1. 1 << 5
<< is the left shift operator.
It shifts the binary bits of 1 5 positions to the left.
Binary representation:
1 = 000001
After shifting 5 positions:
000001 << 5
= 100000
Binary 100000 is equal to 32 in decimal.
So:
1 << 5
gives:
32
2. 32 - 1
Now the expression becomes:
32 - 1
Therefore:
31
3. print()
The print() function displays the final result:
31
✅ Final Output
31

0 Comments:
Post a Comment