What is 'Scope' in coding?

Asked by stem_mind · 2 weeks ago

1 Answer

34
amorebise · 2 weeks ago Top Answer

Scope determines where a variable can be seen. A variable created inside a function is 'local'—it only exists inside that function.

It’s like a secret shared inside a house; people on the street (outside the function) don't know it. This prevents different parts of your program from messing with each other.

Log in to add a comment.