Hacker News new | ask | show | jobs
by marcosdumay 1312 days ago
a = [1, 2]

b = a

b[0] = 3

print(a)

What does the above print? If the language implements reference semantics, it prints [3, 2]. If it implements value semantics, it prints [1, 2].

1 comments

Thank you