Python Variables



  • A Python variable is a reserved memory location to store values.

  • In other words, a variable in a python program gives data to the computer for processing.

Types of Variables  

  1. Global Variables 

  2. Local Variables

1. Global Variable

  • The variables which are declared outside of function are called global variables. These variables can be accessed in all functions of that module.

  • It always declare outside the  functions or modules.

2. Local Variable

  • The variables which are declared inside a function are called local variables. Local variables are available only for the function in which we declared it.i.e from outside of function we cannot access.   

  • It declare inside the function.





Post a Comment

Post a Comment (0)