CommerceBitwise And Boolean MCQs
Practice Bitwise And Boolean MCQs for competitive exams.
Bitwise And Boolean MCQs
Practice questions from this topic.
What will be the output of the following Python expression? int(1011)?
- A. 1011
- B. 11
- C. 13
- D. 1101
Correct Answer: A
What is the result of 5 ^ 5 ?
- A. 0
- B. 10
- C. 5
- D. 1
Correct Answer: A
What will be the output of the following Python expression if x=15 and y=12? x & y
- A. b1101
- B. 0b1101
- C. 12
- D. 1101
Correct Answer: C
What will be the output of the following Python expression? 0x35 | 0x75
- A. 115
- B. 116
- C. 117
- D. 118
Correct Answer: C
What will be the output of the following Python code? ['f', 't'][bool('spam')]
- A. t
- B. f
- C. No output
- D. Error
Correct Answer: A
What is the result of not True ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: B
What is the result of ~5 ?
- A. 5
- B. -5
- C. 10
- D. -6
Correct Answer: B
What is the result of 12 ^ (7 << 1) ?
- A. 26
- B. 22
- C. 20
- D. 10
Correct Answer: B
What will be the output of the following Python code if a=10 and b =20? a=10 b=20 a=a^b b=a^b a=a^b print(a,b)
- A. 10 20
- B. 10 10
- C. 20 10
- D. 20 20
Correct Answer: C
What is the result of 7 ^ 7 ?
- A. 0
- B. 14
- C. 7
- D. 1
Correct Answer: A
What will be the output of the following Python code snippet? bool(‘False’) bool()
- A. True True
- B. False True
- C. False False
- D. True False
Correct Answer: D
What is the result of (10 >> 1) & 3 ?
- A. 1
- B. 3
- C. 2
- D. 0
Correct Answer: A