Scope | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Scope

I’m not clear what the scope is, could someone help me, thanks

11th May 2020, 4:39 AM
Zhengrong Yan
Zhengrong Yan - avatar
3 Answers
+ 4
David Yan Scope of a variable means where it can be accessed If we declare a variable in side a function then it can only be accessed from the function only. If we declare variable outside all the function the it can be accessed anywhere from the program it is called global variable
11th May 2020, 5:05 AM
Bensen
+ 5
Yes its true what Bensen said. also to add, if you declare local and global variable with same name, the local variable is used over the variable with global scope.
11th May 2020, 5:41 AM
Gen2oo
Gen2oo - avatar
+ 2
https://www.sololearn.com/post/985319/?ref=app help me please see my post ,I want to make working scope.....
14th Mar 2021, 12:44 PM
NOOR
NOOR - avatar