0

What does the "|" symbol mean?

def f(m,n): return m|n print(f(10,20)) Output: 30 Thank you for your help :)

4/4/2018 7:30:34 PM

Stephane Gronemeyer

3 Answers

New Answer

+2

Bitwise OR https://code.sololearn.com/cbUZQvD9le8A/?ref=app

+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!