< 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 the function of a program and is accessible only from within the same function in the program 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 within a Python program. So, let us see how it is done in the upcoming 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