Advertisements
Advertisements
प्रश्न
What will be the output of the following Python code?
i = 5
print(i,end='@@')
def add():
global i
i = i+7
print(i,end='##')
add()
print(i)विकल्प
5@@12##15
5@@5##12
5@@12##12
12@@12##12
MCQ
Advertisements
उत्तर
5@@12##12
Explanation:
i starts as 5, printed first → 5@@.
Inside the function, i becomes 12 (global change) → prints 12##.
Finally, printing i again shows 12 → output 5@@12##12.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
