+ 3
Print(10|7)?
why it is showing 15 as output can any one explain?
6 Answers
+ 16
You are performing a binary or operation (|).
0b1010 (10 in binary)
OR 0b0111 ( 7 in binary)
----------------------
0b1111 (15 in binary)
+ 5
Just leaving this lesson, so you can further study about it.
https://www.sololearn.com/learn/4073/?ref=app
Happy new Year!!!
+ 5
Alice there are lots of lessons regarding bitwise operations. Here is the link if you like to learn.
https://www.sololearn.com/learn/4070/?ref=app
+ 2
Alice : | is a biteise operator, so it converts the decimal to binary format and performs bitwise OR opearation
+ 1
thanks
+ 1
Ohh Questions like this usually are in my python challenges :) thanks for explanation guys đđ