examples of global and local variable
Answers
Answered by
0
Answer:
When we print the variable inside foo() it outputs local x: 10 . This is called the local scope of the variable. Similarly, when we print the variable outside the foo() , it outputs global x: 5 . This is called the global scope of the variable.
Similar questions
Science,
2 months ago
World Languages,
2 months ago
Math,
2 months ago
Math,
4 months ago
English,
4 months ago
India Languages,
9 months ago