+ 2
what does it mean in python: i&1
Please, help to understand instruction
5 Answers
+ 5
with 7 111&101 = 101 or 5, with 8 or 1000&0101 = 0000 or 0
+ 4
it is binary "and".
Eg 7 = 111
111 and
001
= 1
Actually it is a test if a number i is odd.
if yes, the result is 1.
+ 3
& is the bit and operator. i&1 is 0 for even numbers and 1 for odd. if i is 5, 101&001=001 as that is the only bit that is 1 in both numbers.
+ 2
Thank you. And what is i&5, for example?
+ 1
Hey, MR. JOHN WELLS I LIKE YOUR KNOWLEDGE AND EXPERIENCE IN THIS FIELD, Is there any way I can contact you, as I want to be your student....
🙏🙏🙏