Report Bug

Quswhat will the output of : print(5&3) Qusइसका आउटपुट क्या होगा: print(5&3)


A. 1
B. 8
C. True
D. False


Solution
A. 1



Explanation

The & operator in Python performs bitwise AND operation. It takes the binary representations of two numbers and performs a bitwise AND operation on each pair of corresponding bits.

binary of 5 is : 101

binary of 3 is : 011

bitwise &    : 001 which 1 in decimal so the correct answer is 1

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad