About Variable and its uses

Types of Variables.

Scope of Local and Global Variable.

Please Explain in shortly.

@sathsaran01

There are two types of variables in Python - Local variable and Global variable.

A global variable is a variable that is accessible globally.

A local variable is one that is only accessible to the current scope, such as variables used in a single function definition.

The scope of global variables is the entire program whereas the scope of local variable is limited to the function where it is defined.

1 Like