Using Global Variables in Python Functions
Real Python Real Python
188K subscribers
1,033 views
0

 Published On May 2, 2024

This is a preview of the video course, "Working With Global Variables in Python Functions." A global variable is a variable that you can use from any part of a program, including within functions. Using global variables inside your Python functions can be tricky. You’ll need to differentiate between accessing and changing the values of the target global variable if you want your code to work correctly.

This is a portion of the complete course, which you can find here:
https://realpython.com/courses/global...

The rest of the course covers:
- Access, create, and modify global variables within your functions with the globals() function
- Understanding mutability
- Deciding when to use globals
- Explore strategies to avoid using global variables in Python code

show more

Share/Embed