Quiz: Introduction to Modules and Libraries

Practice Python’s built-in modules and libraries to extend your code’s power.

We'll cover the following...

In the last lesson, you discovered how to extend Python’s power by importing modules—toolboxes full of pre-written code. You explored built-in modules like random, math, and datetime, learning how to add randomness, do complex math, and work with time, all with just a single import.

Let’s test your understanding before jumping into the next challenge!

Technical Quiz
1.

What is a Python module?

A.

A file that stores variables only

B.

A toolbox of prewritten code (functions, constants, etc.)

C.

A type of loop in Python


1 / 3

Well done! You’ve learned how to import and use Python modules to bring new features into your code, without writing them from scratch.

What’s next?

Time to roll the dice—literally! In this hands-on project, you’ll:

  • Use the random module.

  • Create a function that simulates rolling two six-sided dice.

  • Print the results of each roll, just like in a real game.

This is a fun way to reinforce how modules and functions can work together in practical code.
Let’s bring chance and code together with Python!