Using Global Variables in Python Functions

Pubblicato il: 02 May 2024
sul canale di: Real Python
1,438
65

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


In questa pagina del sito puoi guardare il video online Using Global Variables in Python Functions della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Real Python 02 May 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,438 volte e gli è piaciuto 65 spettatori. Buona visione!