Back Navigation Next Navigation Conceptual Review (page 11 of 55)

Chain statements We may chain functions and methods together to perform multiple actions on an object in a single statement. The chains are evaluated from left to right.

Import packages Not all packages and libraries that are installed with your interpreter are available by default. As a result, you must import them before using them. Examples include random, math, fractions, platform & sys.

We have several options to import modules. The different methods will determine how we reference the methods and attributes in the modules. For instance, "import math" requires full qualifaction such as print(math.pi). However, "from math import pi" does not require full qualification for pi. Therefore, print(pi) would be a valid statement.