< Prev
Next >

Python - Local Variables

In this Python tutorial, we are going to explain the concept of local variables. A local variable is declared inside a function of a program and it is accessible only from within the same function i.e. from the inside of the same function and not outside it.

The memory given to a local variable is taken away as soon the control goes outside the function(in which the local variable is defined). Consequently, we could say that local variables have a local scope.

In order to understand the concept of local variables, we are going to explain how we can declare, initialize, access and pass the values of local variables. So, let us see how it is done in the upcoming Python programs.

Please Subscribe

Please subscribe to our social media channels for daily updates.

Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page



Please check our latest addition