0

hey, guuuys, pls explain me, what these (&, āˆ§, |)operators do?

8th Oct 2020, 2:34 PM
Š–ŠµŠ½Ń‘Šŗ
Š–ŠµŠ½Ń‘Šŗ - avatar
2 Answers
+ 1
They are Binary operators (you can search about them using any search engine) ,they work on bits ,instead on number Like for example 3|5 3 has a binary value equal to 0b11 and 5 has a binary value equal to 0b101 "|" is a binary "or" operator which compared two bits like for 1 and 0 it will return 1 , for 1 and 1 it will return 1, And for 0 and 0 it will return 0 So if we compare the above two binary values 0b011 0b101 we get 0b111 which is equivalent to 7 in decimal system ,"0b is a prefix which is used for representing binary number in python
8th Oct 2020, 2:50 PM
Abhay
Abhay - avatar
0
shoul i know all of these binary values? it seems horriblešŸ™ƒ
8th Oct 2020, 2:57 PM
Š–ŠµŠ½Ń‘Šŗ
Š–ŠµŠ½Ń‘Šŗ - avatar