
O-Level Module M3-R5 – Python Programming MCQs
Who developed the Python language?
a) Dennis Ritchie
b) James Gosling
c) Guido van Rossum
d) Bjarne Stroustrup
Answer: c) Guido van Rossum
What is the correct file extension for Python files?
a) .pt
b) .py
c) .pyt
d) .python
Answer: b) .py
Which of the following is used to display output in Python?
a) echo
b) print()
c) write()
d) display()
Answer: b) print()
What is the output of: print(type(10.5))?
a) <class ‘int’>
b) <class ‘str’>
c) <class ‘float’>
d) <class ‘complex’>
Answer: c) <class ‘float’>
Which of these is a valid variable name in Python?
a) 1name
b) @name
c) name_1
d) class
Answer: c) name_1
What is the correct way to create a list in Python?
a) list = (1, 2, 3)
b) list = {1, 2, 3}
c) list = [1, 2, 3]
d) list = <1, 2, 3>
Answer: c) list = [1, 2, 3]
Which keyword is used for function in Python?
a) def
b) func
c) define
d) function
Answer: a) def
What is the output of: len(“O-Level”)?
a) 6
b) 7
c) 8
d) 5
Answer: b) 7
What is the correct way to start a loop in Python?
a) for i to 10
b) loop i in range(10)
c) for i in range(10):
d) foreach i in range(10):
Answer: c) for i in range(10):
Which of the following is not a Python data type?
a) integer
b) float
c) real
d) list
Answer: c) real