Question:medium

Consider the statements given below and then choose the correct output from the given options:
def Change(N):
    N = N + 10
    print(N, end='$$')

N = 15
Change(N)
print(N)

Show Hint

In Python, integers are immutable,
and changes to function parameters do not affect the original variable.
Updated On: Jan 14, 2026
  • 25$$15
  • 15$$25
  • 25$$25
  • 25 25$$
Show Solution

The Correct Option is A

Solution and Explanation

A function `Change` accepts an argument `N`. Within this function, `N` is incremented by 10 and then printed, followed by `$$`. Before the function call, `N` is initialized to 15. When `Change(N)` is invoked, the function's local `N` becomes 25. This modification is isolated to the function's scope because Python passes integers by value (immutability), leaving the original `N` unchanged. Consequently, the subsequent `print(N)` outside the function outputs the original value, 15. The final output is `25$$15`, making option (A) correct.
Was this answer helpful?
0