Using Global Variables in Python Functions

Real Python
Real Python
1.2 هزار بار بازدید - 2 ماه پیش - This is a preview of
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
2 ماه پیش در تاریخ 1403/02/13 منتشر شده است.
1,231 بـار بازدید شده
... بیشتر