Post

Python Developer
Python Developer@Python_Dv·
What is the output? Write your answer in the comments and share it with your friends✅✅
Python Developer tweet media
English
22
14
135
14.7K
Jay
Jay@learnaiwthme·
@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
0
0
13
1.2K
Earnest Codes
Earnest Codes@Earnesto037·
@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
1
0
7
1.2K
PyBerry Tech 🐍🍓
PyBerry Tech 🐍🍓@PyBerryTech·
@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
0
0
4
691
ÌYÀNDÁ🏞
ÌYÀNDÁ🏞@iyandawaheed1·
@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
0
0
3
313
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@Python_Dv Answer: 15 5 — local value inside func() doesn’t change the global value.
English
0
0
2
751
MacroMindGames
MacroMindGames@MacroMindGames·
A ...good example of 'scope'
English
0
0
0
281
Andhika
Andhika@anperkasa·
@Python_Dv Can someone explain / tell me what is the effect of end= “ “ ??
English
0
0
0
3
Ranjan
Ranjan@Ranjanrgdev·
@Python_Dv A. 15 and 5 First, the function is called and then the value
English
0
0
0
498
Jake Tracy
Jake Tracy@JakedaVyse·
@Python_Dv A, since inside the function created value is its own variable disconnected from the variable declared outside of the function.
English
0
0
0
22
Paylaş