Python 3 Tutorial: How To Use Local Variables

Veröffentlicht am: 25 November 2016
auf dem Kanal: Code master
2,785
14

Be sure to like, share and comment to show your support for our tutorials.

=======================================
Channel - https://goo.gl/pnKLqE
Playlist For This Tutorial - https://goo.gl/EyZFti
Latest Video - https://goo.gl/atWRkF
Facebook -   / mastercodeonline  
Twitter - https://twitter.com/mastercodeonlin?l...
Website - http://mastercode.online
======================================

Now that we understand what a function is, what it does and how it is structured we need to dive into local variables. There is not much to a local variable once you have an understanding what a local variable is.+

What Is A Local Variable?
A local variable is a variable that lives inside a function. This variable is only available to the code within the function. We are unable to call the variable outside the function. This variable only exists when the function is ran. Even if we use our local variable to return an object that variable is not available to the code outside the variable.

When we return an object to the receiver we are only sending back the object that was created by the function run. It is important to note as well that a local variable will not remember the object that it just represent on the last function run this means anytime we need an object from a function that function must rerun for every ask.

Do not get confused if a variable is assigned outside a function this is referred to as global variable and this variable is available to all the code. We will discuss global variables more in a future tutorial.


Auf dieser Seite können Sie das Online-Video Python 3 Tutorial: How To Use Local Variables mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code master 25 November 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,785 Mal angesehen und es wurde von 14 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!