+ 2
syntax "|", what is mean ..
a = 5 | 5 b = 10 |5 print(a + b)
3 Respuestas
+ 4
They are knows an bitwise operators that operates on bit , "|" Is OR bitwise operator that returns "0" for 0 and 0 , "1" for 0 and 1 , and "1" for 1 and "1".
5 has a binary value of "0101" and 10 has a value of "1010" , when you apply "|" on 5 and 5 , it yields a binary value of 0101 ("5" in decimal number system) .
When applied on 10 and 5 , it yields 1111 ("15" In decimal)
So you get 20 as a result.
https://www.sololearn.com/learn/4070/?ref=app
+ 1
Thanks
0
Please help me