How will you share variables across modules in Python?

We can create a common module with variables that we want to share.

This common module can be imported in all the modules in which we want to share the variables.

In this way, all the shared variables will be in one module and available for sharing with any new module as well.

Read the full book at www.amazon.com
Posted in Python, Python Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*