Explore topic-wise MCQs in Python.

This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the value of the following Python expression?

A. ‘0bx1000’
B. 8
C. 1000
D. ‘0b1000’View Answer
Answer» E.
2.

Which of the following represents the bitwise XOR operator?

A. &
B. ^
C. |
D. !
Answer» C. |
3.

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

A. b1101
B. 0b1101
C. 12
D. 1101View Answer
Answer» D. 1101View Answer
4.

To find the decimal value of 1111, that is 15, we can use the function:

A. int(1111,10)
B. int(‘1111’,10)
C. int(1111,2)
D. int(‘1111’,2)
Answer» E.
5.

What will be the value of x in the following Python expression, if the result of that expression is 2?

A. 8
B. 4
C. 2
D. 1View Answer
Answer» B. 4
6.

What will be the output of the following Python code snippet if x=1?

A. 8
B. 1
C. 2
D. 4View Answer
Answer» E.