Post

@Python_Dv The output is:
15 5
Why:
Inside func(), value = 15 is a local variable, so print(value, end=" ") prints 15.
Outside the function, the global value stays 5, so print(value) prints 5.
Correct choice: A ✅
English

@Python_Dv Global vs. Local Scope
The answer is A): 15 5.
This tests your knowledge of variable scope—specifically, how Python distinguishes between variables defined inside a function and those defined outside of it.
Why is the answer 15 5?
Global Initialization: value = 5
English

@Python_Dv value inside func() is a local variable, and value outside is a global variable.
What happens:
•Inside func(), Python uses the local value = 15
•Outside, Python uses the global value = 5
Output: 15 5
English

@Python_Dv Answe is A (15,5),
we have a global value 5 which is outside of the fxn(), and the fxn() uses the local value 15
English

@Python_Dv Answer: 15 5 — local value inside func() doesn’t change the global value.
English

@Python_Dv Can someone explain / tell me what is the effect of end= “ “ ??
English

@Python_Dv A. 15 and 5
First, the function is called and then the value
English

@Python_Dv 15 5 but if we declare "global value" we can see 15 15
English

@Python_Dv A, since inside the function created value is its own variable disconnected from the variable declared outside of the function.
English











