+ 2
X | Y
print(x | y) what is the | doing ?
6 Réponses
+ 4
example:
3 = 0011
5 = 0101
3l5 = 0111 = 7
if there is a one on the position in 3 or 5, the result will be 1.
first position: 0 or 0 = 0
second position: 0 or 1 = 1
third: 1 or 0 = 1
fourth: 1 or 1 = 1
result : 111
+ 4
It's bitwise OR. You can read more about it here https://stackoverflow.com/questions/5988665/pipe-character-in-JUMP_LINK__&&__python__&&__JUMP_LINK
+ 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
+ 1
thanks :)
+ 1
You are welcome :) !
+ 1
isnt 1011 = 11?
and what is the bitwise or needed for ?