Test 2: Libraries, Lists, Testing and Debugging

MCQs

30 questions · 25 min · 30 marks

Want to try first? Take the free Computer Science test: 94hbp-7gz9m-ufent-tsj4r

Sample questions

The first 5 of 30. Try each one, then tap to see the answer.

  1. Question 1

    Python offers an extensive standard library that includes:

    • AOnly external packages
    • BBuilt-in modules and data structures
    • COnly graphics tools
    • DOnly operating system files
    Show answer

    Answer: B

    Python's extensive standard library includes built-in modules and data structures.

  2. Question 2

    What does a data structure refer to?

    • AA particular format or method for organizing and storing data
    • BA type of loop
    • CA syntax error
    • DA debugging tool
    Show answer

    Answer: A

    A data structure is a particular format or method for organizing and storing data.

  3. Question 3

    In Python, libraries are like:

    • AToolboxes full of useful tools
    • BEmpty folders
    • CError messages
    • DLoops
    Show answer

    Answer: A

    Libraries are like toolboxes or pre-built toolkits that help solve problems without building everything from scratch.

  4. Question 4

    Which library is used to generate random numbers?

    • ADatetime
    • Bstatistics
    • Crandom
    • Dmath
    Show answer

    Answer: C

    The random library is used to generate random numbers.

  5. Question 5

    Which keyword is used to bring a library into your Python program?

    • Aimport
    • Binclude
    • Cusing
    • Dload
    Show answer

    Answer: A

    Libraries are brought into a program using the import statement.

More tests in Control Structures in Python

Practise with a free account

Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.

Create free account