0

What the use of the pipe | with numbers in python?

For example this code: a = 5|5 b = 10|5 ab= a+b print (ab) >> this evaluates to 20 Could any one explain how did this happen?

10th May 2021, 5:24 AM
Alaa Aldeen Shammr
Alaa Aldeen Shammr - avatar
2 ответов
+ 2
First you should change 5 into binary numbers then add them e.g 5 into binary 10 into binary https://www.sololearn.com/learn/4073/?ref=app
10th May 2021, 5:37 AM
Sâñtôsh
Sâñtôsh - avatar
+ 1
Såñtösh Maravi Thank you very much 🙏
10th May 2021, 5:39 AM
Alaa Aldeen Shammr
Alaa Aldeen Shammr - avatar