An import statement brings definitions from another file or library into your program, so you can use existing classes and functions instead of copying their definitions. Imports also help keep code organized. section 35.1
Importing classes from another file
If shapes.py defines Circle and Rectangle, write `import shapes` in another file in the same folder. You can then create objects from those classes. The import line uses the filename without its .py extension. section 35.1
Imports can also make library features available. For example, after `import random`, you can use random.random() for a value from 0 up to, but not including, 1; random.randint(a, b) for an integer from a through b; or random.choice(L) for an element from list L. section 34.1
import shapes
See the import line used to access classes defined in shapes.py. section 35.1












