Explanation:
num = 6 sets num to 6.
decrement(num) calls the function, but num is passed by value (since integers are immutable in Python).
-
Inside the function, num -= 2 only affects the local variable. It doesn't change the original num.
-
So, print(num) still prints 6.
✅ Final Output:
6
0 Comments:
Post a Comment