November 2018
Beginner
304 pages
7h 35m
English
In the previous screenshot, we performed a basic module import. This just means that we imported the module, and then referenced something within it through the dot nomenclature. With this type of import, the main program and the imported module maintain their separate namespaces, hence the need to explicitly identify a function through the dot nomenclature.
There are other ways to import modules. One of the most common is to use the from version of import to get only specified objects from a module, rather than the entire module, as shown in the following screenshot.

In this case, we are importing just randint() ...
Read now
Unlock full access