Can u..say..the.output ..? Doubt....! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can u..say..the.output ..? Doubt....!

a=2 b=8 if(a&b): b-=1 else: a+=1 print b a&b..means..?

16th Jan 2017, 3:19 PM
Manu Mathew Cherian
Manu Mathew Cherian - avatar
2 Answers
+ 3
It's the bitwise operator for AND. a is 0010 in binary and b is 1000 in binary. I'm not sure if this is the correct answer but I would say a&b is 0000 which is 0. Output : 8?
16th Jan 2017, 4:35 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
0
yuri!!! on ice is the beeeeesssssttttt
17th Jan 2017, 10:53 AM
bob