+ 1

Anyone know what this "|" Bitwise mean in pynthon??

14th Jul 2023, 7:37 PM
Indiphile Menziwa
Indiphile Menziwa - avatar
5 ответов
+ 5
Bitwise operators are used to compare (binary) numbers: Operator Name Description & AND Sets each bit to 1 if both bits are 1 | OR Sets each bit to 1 if one of two bits is 1 ^ XOR Sets each bit to 1 if only one of two bits is 1 ~ NOT Inverts all the bits << Zero fill left shift Shift left by pushing zeros in from the right and let the leftmost bits fall off >> Signed right shift Shift right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off
14th Jul 2023, 8:07 PM
JaScript
JaScript - avatar
14th Jul 2023, 8:19 PM
JaScript
JaScript - avatar
+ 2
You can find it out by searching for "bitwise operations in Python" https://realpython.com/python-bitwise-operators/
14th Jul 2023, 8:08 PM
Lisa
Lisa - avatar
+ 2
Thanks then what context would it have or output if comes likes this print(5|3)
14th Jul 2023, 8:14 PM
Indiphile Menziwa
Indiphile Menziwa - avatar
0
Thank you guys😊🙏
16th Jul 2023, 12:35 PM
Indiphile Menziwa
Indiphile Menziwa - avatar