import — Expert Playground
Loads a module or package into the current namespace
Python Playground
Output
Click "Run" to execute your codePython's import system uses finders and loaders. sys.meta_path holds finders that locate modules. sys.modules caches imported modules. Understanding this enables custom import hooks.
Challenge
Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?