__name__Easy Playground

The name of a module; equals '__main__' when run as a script

Python Playground
Output
Click "Run" to execute your code

__name__ is a special attribute that the name of a module; equals '__main__' when run as a script.

Challenge

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