In short
A module is a file of ready-made Python code, and a library is a collection of modules. The import command lets your program use them.
The standard library comes with Python. Examples are math for , and , random for random numbers, and statistics for means and standard deviations. Outside libraries such as NumPy and Matplotlib are installed once and then imported in the same way. A common habit is import numpy as np, which gives the library a short name.
This prints 1.4142135623730951 3.141592653589793.
Python labs run in your browser. Type the code, run it and see what happens.
Open a Python lab