Computer Science, asked by reshmi3152004, 8 months ago

Explain the types of scopes for variable or LEGB rule with example. in detail ​

Answers

Answered by TheWorker
5

Answer = The scope of a name or variable depends on the place in your code where you create that variable. The Python scope concept is generally presented using a rule known as the LEGB rule. The letters in the acronym LEGB stand for Local, Enclosing, Global, and Built-in scopes.

mark me brainliest......

Answered by syedashiq2005
7

Answer:

Hello

Explanation:

The concept of scope rules how variables and names are looked up in your code. It determines the visibility of a variable within the code. The scope of a name or variable depends on the place in your code where you create that variable. The Python scope concept is generally presented using a rule known as the LEGB rule.

The letters in the acronym LEGB stand for Local, Enclosing, Global, and Built-in scopes. This summarizes not only the Python scope levels but also the sequence of steps that Python follows when resolving names in a program.

Please make me brainliest

Similar questions