Is there a a pattern in this? It is very confusing to understand. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there a a pattern in this? It is very confusing to understand.

#X and Y are integers print(X|Y)

10th Apr 2019, 1:56 AM
Thimira Rathnayake
Thimira Rathnayake - avatar
4 Answers
+ 4
It's the bitwise operator OR. https://www.sololearn.com/learn/4073/
10th Apr 2019, 2:22 AM
Diego
Diego - avatar
+ 2
The | is a bitwise or. Which has to do with manipulating bits. In general you probably won't ever need to use it, but here's a stackoverflow with some good awnsers if you're curious enough: https://stackoverflow.com/questions/1746613/bitwise-operation-and-usage
10th Apr 2019, 2:13 AM
Ahri Fox
Ahri Fox - avatar
+ 1
Thnks! Ahri Fox
10th Apr 2019, 2:14 AM
Thimira Rathnayake
Thimira Rathnayake - avatar
+ 1
Thanks! Diego
10th Apr 2019, 2:26 AM
Thimira Rathnayake
Thimira Rathnayake - avatar