E. 3 42
Explanation:
p1 = 1 just reassigns the local copy of p1. It does not affect the original variable.
p2[0] = 42 modifies the list in-place, which does affect the original list outside the function.
x = 3
y = [1, 2, 3]
func(x, y):
p1 gets a copy of x → p1 = 3, but p1 = 1 does not affect x
p2 is a reference to the same list as y, so p2[0] = 42 changes y[0]
x is still 3
y[0] is now 42
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Donny_575
1 month, 1 week agoakumo
1 month, 2 weeks ago