MCQ Answer

Give the output of: print(2^5)

Give the output of: print(2^5)

इसका आउटपुट क्या होगा : print(2^5)
Topic : Operators Expressions and Python Statements

A. 32

B. 7

C. 10

D. 3




Correct Answer is :

B. 7



Explanation

here ^ is known as bitwise XOR operator which perform the XOR option on bits

in this question 2^5 :

2=> 010 binary of 2

5=> 101 binary of 5

2^5=> 111 which is 7 in decimal 


so the answer is 7

(in XOR if bits are same the it gives 0 and if bits are deferent the it give 1)

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz