fromAdvanced Playground

Used with import to bring in specific names from a module

Python Playground
Output
Click "Run" to execute your code

__all__ is a list of strings defining the public API. 'from module import *' only imports names in __all__ if it exists, otherwise all non-underscore names.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?