🐍 O-Level Module M3-R5 – Python Programming MCQs

  1. Who developed the Python language?

  2. a) Dennis Ritchie

    b) James Gosling

    c) Guido van Rossum

    d) Bjarne Stroustrup

    Answer: c) Guido van Rossum

  3. What is the correct file extension for Python files?

  4. a) .pt

    b) .py

    c) .pyt

    d) .python

    Answer: b) .py

  5. Which of the following is used to display output in Python?

  6. a) echo

    b) print()

    c) write()

    d) display()

    Answer: b) print()

  7. What is the output of: print(type(10.5))?

  8. a) <class ‘int’>

    b) <class ‘str’>

    c) <class ‘float’>

    d) <class ‘complex’>

    Answer: c) <class ‘float’>

  9. Which of these is a valid variable name in Python?

  10. a) 1name

    b) @name

    c) name_1

    d) class

    Answer: c) name_1

  11. What is the correct way to create a list in Python?

  12. 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]

  13. Which keyword is used for function in Python?

  14. a) def

    b) func

    c) define

    d) function

    Answer: a) def

  15. What is the output of: len(“O-Level”)?

  16. a) 6

    b) 7

    c) 8

    d) 5

    Answer: b) 7

  17. What is the correct way to start a loop in Python?

  18. 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):

  19. Which of the following is not a Python data type?

  20. a) integer

    b) float

    c) real

    d) list

    Answer: c) real