Python Global and Local Variables

Pubblicato il: 03 novembre 2020
sul canale di: Painless Programming
85
4

Python Global and Local Variables.
python uses pass by object reference, which can be difficult to understand at first.
In my simple example you pass a variable to the function, but when the function makes a change to it, it is only changing a local variable and the global variable remains unchanged.

Adding the keyword global allows the function to make changes to a global variable.


In questa pagina del sito puoi guardare il video online Python Global and Local Variables della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Painless Programming 03 novembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 85 volte e gli è piaciuto 4 spettatori. Buona visione!