Asked • 05/05/19

Using global variables in a function?

How can I create or use a global variable in a function?If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?

1 Expert Answer


Jake Z. answered • 05/05/19

5.0 (337)

Experienced TA & Tutor for Computer Science: Python/Java/JavaScript/C#

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.