June 2017
Beginner
352 pages
8h 39m
English
As mentioned earlier, Python comes with an extensive standard library, an aspect of Python that is often referred to as batteries included. The standard library is structured as modules, a topic we'll discuss in depth later. What's important at this stage is to know that you gain access to standard library modules by using the import keyword.
The basic form of importing a module is simply the import keyword followed by a space and the name of the module. For example, lets see how we can use the standard library's math module to compute square roots. At the triple-arrow prompt we type the following command:
>>> import math
Since import is a statement which doesn't return a value, Python doesn't print anything ...
Read now
Unlock full access