Commerce

Bitwise 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)?

  1. A. 1011
  2. B. 11
  3. C. 13
  4. D. 1101
Report Error

What is the result of 5 ^ 5 ?

  1. A. 0
  2. B. 10
  3. C. 5
  4. D. 1
Report Error

What will be the output of the following Python expression if x=15 and y=12? x & y

  1. A. b1101
  2. B. 0b1101
  3. C. 12
  4. D. 1101
Report Error

What will be the output of the following Python expression? 0x35 | 0x75

  1. A. 115
  2. B. 116
  3. C. 117
  4. D. 118
Report Error

What will be the output of the following Python code? ['f', 't'][bool('spam')]

  1. A. t
  2. B. f
  3. C. No output
  4. D. Error
Report Error

What is the result of not True ?

  1. A. True
  2. B. False
  3. C. None
  4. D. Error
Report Error

What is the result of ~5 ?

  1. A. 5
  2. B. -5
  3. C. 10
  4. D. -6
Report Error

What is the result of 12 ^ (7 << 1) ?

  1. A. 26
  2. B. 22
  3. C. 20
  4. D. 10
Report Error

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)

  1. A. 10 20
  2. B. 10 10
  3. C. 20 10
  4. D. 20 20
Report Error

What is the result of 7 ^ 7 ?

  1. A. 0
  2. B. 14
  3. C. 7
  4. D. 1
Report Error

What will be the output of the following Python code snippet? bool(‘False’) bool()

  1. A. True True
  2. B. False True
  3. C. False False
  4. D. True False
Report Error

What is the result of (10 >> 1) & 3 ?

  1. A. 1
  2. B. 3
  3. C. 2
  4. D. 0
Report Error