You'll want to watch out for a common mistake: forgetting to initialize variables. If you try to use a variable without first initializing it, you'll run into a NameError. This is the Python interpreter catching the mistake and telling you that you’re using an undefined variable. The fix is pretty simple: initialize the variable by assigning the variable a value before you use it.
Another common mistake to watch out for that can be a little trickier to spot is forgetting to initialize variables with the correct value. If you use a variable earlier in your code and then reuse it later in a loop without first setting the value to something you want, your code may wind up doing something you didn't expect. Don't forget to initialize your variables before using them!
Christine Rafla
Email us at - techlaboffice77@gmail.com
In questa pagina del sito puoi guardare il video online 26 Why Initializing Variables Matters | Python [ COMPLETE COURSE ] della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Tech Lab 16 luglio 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 192 volte e gli è piaciuto 3 spettatori. Buona visione!