Science, asked by rahulmulik, 7 months ago

Define LEGB rule of variables.​

Answers

Answered by kanishkhandelwal
2

Answer:

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 letters in the acronym LEGB stand for Local, Enclosing, Global, and Built-in scopes.

Explanation:

hope it helps you............

Answered by quantumglobe
0

Answer:

Python variables are searched in the following order of namespaces.

Local -> Enclosed -> Global -> Built-in

This is also called LEGB rule for variable scope resolution.

Similar questions