class_25_global_local_vatiable.txt - Types of Variable...

This preview shows page 1 - 2 out of 2 pages.

Types of Variable:- Python supports 2 types of variables. 1.Global Variable 2.Local Variable Global Variable:- The variable which are declared outside of function are called global variables.These variable can be acccessed in all functions of that module. ex:- d= 40 def wish(): a= 10 b = 20 return a+b+d def well(): print(d) re = wish() print(re) well() Local Variable:- The variable which are declared inside a function are called local variables.Local variable are available onlt for the function in which we declare it that is from

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture