What is the role of it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the role of it?

5|5 Can you guys tell me what is the role of this symbol "|"

24th Feb 2021, 11:20 PM
OSAMA AGDID
OSAMA AGDID - avatar
4 Answers
+ 3
Binary operator "or" which operates on bits ,just google about it .
24th Feb 2021, 11:30 PM
Abhay
Abhay - avatar
+ 2
if outside quotes, | operator is binary OR operator... if inside quotes, it could be a lot of things, but usually act as a separator...
24th Feb 2021, 11:29 PM
visph
visph - avatar
+ 1
Idk if it's the same in python, but in C/C++ this symbol is just bitwise 'or'. For example 10|6= 1010 0110 = 1110 = 14 Because it compares those 0/1 in columns, and if there is at least one 1, then final value becomes 1 too
24th Feb 2021, 11:29 PM
Michal Doruch
+ 1
Please read this thread below👇 https://www.sololearn.com/discuss/2695403/?ref=app
25th Feb 2021, 2:03 AM
∆BH∆Y
∆BH∆Y - avatar