0

About python MCQ

#python How {print(5|3)=7} ?

24th Sep 2022, 11:35 AM
Mustakim Rahman
Mustakim Rahman - avatar
4 Respostas
+ 2
Bitwise OR operation yields true (1) when either one of its operands were true. In 4 bits integer example below you can see, the result of bitwise OR operation of 5 and 3. The resulting bit becomes true (1) when either one bit of the operands also had a true value (1) - at the same offset. 0101 (5) 0011 (3) --------------- OR 0111 (7)
24th Sep 2022, 12:36 PM
Ipang
+ 5
Wow...that's so easy.... thanks #Ipang for helping..
24th Sep 2022, 12:38 PM
Mustakim Rahman
Mustakim Rahman - avatar
+ 2
Like how 5|3 = 7 .. why 7? Not anything else?
24th Sep 2022, 11:44 AM
Mustakim Rahman
Mustakim Rahman - avatar
- 2
Huh? What's your question exactly?
24th Sep 2022, 11:38 AM
Slick
Slick - avatar