O Level Python mcq Online Test

o level m3-r5 mcq questions with answers

In this blog i am going to share with you Top 50 O Level Python mcq. 

1. What is the result of cmp(3, 1) ?

A. 0

B. 1

C. True

D. False

2. What does ~~~~~~5 evaluate to ??

A. +5

B. -5

C. +11

D. -11

3. What is the output of print 0.1 + 0.2 == 0.3 ??

A. True

B. False

C. Machine dependent

D. Error

4. Which is the correct operator for power(xy)?

A. X^y

B. X**y

C. X^^y

D. None of the mentioned

5. Which one of these is floor division?

A. /

B. //

C. %

D. None of the mentioned

6. In the Python statement x = a + 5 – b:
a and b are ________
a + 5 – b is ________

A. terms, a group

B. operands, an equation

C. operators, a statement

D. operands, an expression

7. Which function overloads the >> operator?

A. gt()

B. ge()

C. more()

D. None of the above

8. What is the value of the expression 100 / 25?

A. 0

B. 4

C. 4.0

D. 25

9. Operators with the same precedence are evaluated from?

A. Left to Right

B. Right to Left

C. Depends on Compiler

D. None of the above




10. What is the output of print 0.1 + 0.2 == 0.3?

A. True

B. False

C. Machine dependent

D. Error

11. Which of the following is not a complex number?

A. k = 2 + 3l

B. k = 2 + 3J

C. k = 2 + 3j

D. k = complex(2, 3)

12. Is it possible to execute Mathematical operations on string?

A. True

B. False

13. What is the order of precedence in python?
i) Parentheses
ii) Exponential
iii) Multiplication
iv) Division
v) Addition
vi) Subtraction

A. a) i,ii,iii,iv,v,vi

B. ii,i,iii,iv,v,vi

C. ii,i,iv,iii,v,vi

D. i,ii,iii,iv,vi,v

14. Bitwise shift operators (<<, >>) has higher precedence than Bitwise And(&) operator

A. True

B. False

15. What is the output of the following assignment operator
y = 10
x = y += 2
print(x)

A. 10

B. 12

C. Syntax Error

D. none

16. What is the output of the following code
x = 100
y = 50
print(x and y)

A. 50

B. 100

C. True

D. False

17. What does ~4 evaluate to ??

A. -3

B. -4

C. -5

D. +3

18. Which of the following operators has its associativity from right to left in Python ??

A. /

B. //

C. %

D. **

19. What is the answer to this expression, 22 % 3 is?

A. 0

B. 1

C. 5

D. 7

20. What is the output of this expression, 3*1**3?

A. 1

B. 3

C. 9

D. 27

21. What does 3 ^ 4 evaluate to ??

A. 0.75

B. 7

C. 12

D. 81

22. Which one of the following has the same precedence level?

A. Addition and Multiplication

B. Addition and Subtraction

C. Multiplication, Division and Addition

D. Multiplication, Division, Addition and Subtraction

23. Which operator is overloaded by the or() function?

A. |

B. ||

C. /

D. //




24. Should you use the == operator to determine whether objects of type float are equal?

A. Nope, not a good idea.

B. Sure! Go for it.

25. “in” is a operator in python?

A. True

B. False

C. Neither true nor false

D. None of these

26. What is the type of inf?

A. integer

B. float

C. boolean

D. complex

27. Which of the following is incorrect?

A. x = 0x4f5

B. x = 0b101

C. x = 19023

D. x = 03964

28. What is the output of print(2 ** 3 ** 2)

A. 64

B. 512

29. What is the output of the following addition (+) operator
a = [10, 20]
b = a b += [30, 40]
print(a)
print(b)

A. [10, 20, 30, 40]

B. [10, 20, 30, 40]

C. [10, 20]

D. [10, 20, 30, 40]

Also Check Some other O Level Python mcq

O level m3 r5 mcq questions with answers

30. What is the output of the following code
print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))

A. True True False True

B. False True True True

C. True True False True

D. False True False True

31. What is the result of round(0.5) – round(-0.5) ??

A. 0.0

B. 1.0

C. 2.0

D. Value depends on Python version

32. AND is shown by which of the operator ?

A. |

B. %

C. /

D. None of the above

For Live Class Subscribe Our Youtube Channel by click on the below link

https://www.youtube.com/@olevelguruji

33. Which of the following is incorrect ??

A. float(‘inf’)

B. float(‘nan’)

C. float(’12+34′)

D. float(’56’+’78’)

34. The expression Int(x) implies that the variable x is converted to integer.

A. True

B. False

35. Which one of the following has the highest precedence in the expression?

A. Addition

B. Parentheses

C. Exponential

D. Multiplication




36. What will be the output of the following code
a = 1
b = ++a
print(b is a)

A. True

B. False

C. Error

D. None of the above

37. The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same ??

A. True

B. False

38. print(100 & 4)

A. 1

B. 4

C. 100

D. Error

39. What will be the value of the following Python expression ?? 4 + 3 % 5

A. 0

B. 2

C. 4

D. 7

40. Evaluate the expression given below if A = 16 and B = 15 ??
A % B // A

A. 0

B. 1

C. 0.0

D. 1.0

41. What is the output of print(2%6)

A. 0.33

B. 2

C. ValueError

D. None of these

42. Given a function that does not return any value, what value is shown when executed at the shell?

A. bool

B. void

C. int

D. None

43. The function sqrt() from the math module computes the square root of a number. Will the highlighted line of code raise an exception?

x = -100
from math import sqrt
x > 0 and sqrt(x)

A. Yes

B. No

C. void

D. None

44. What is the value of the following expression ??
2+4.00, 2**4.0

A. (6.0, 16.0)

B. (6.00, 16.00)

C. (6, 16)

D. (6.00, 16.0)




45. What is the value of the following expression ??
8/4/2, 8/(4/2)

A. (1.0, 4.0)

B. (1.0, 1.0)

C. (4.0. 1.0)

D. (4.0, 4.0)

I Hope this O Level Python mcq help you for exam.

Also Check Our Latest Uploads

IoT O Level MCQ Questions in hindi

M2r5 mcq questions in hindi

O level m3 r5 mcq questions with answers

Leave a Comment