0
What does the "|" symbol mean?
def f(m,n): return m|n print(f(10,20)) Output: 30 Thank you for your help :)
3 Answers
+ 2
+ 2
| means binary operation OR.
10 in binary is 1010
20 in binary is 10100
1010 | 10100 = 11110 (30)
Make OR on each bit row:
01010
10100
11110
+ 1
I understand perfectly now! Thank you!