A namespace is a collection of names and the details of the objects that the names refer to.
Python has three main types of namespaces:
- Built-In
- Global
- Local
BUILT-IN NAMESPACE
This contains all the python built-in objects and is always accessible, i.e., you don't need to import it to use it.
An example is the print and input function.
GLOBAL NAMESPACE
This is a collection of global modules that can be accessed within a python project once imported.
LOCAL NAMESPACE
This namespace are declared by the programmer and can only be accessed within the project.