Question #316

What is the output of the code snippet below?
a = b = [0, 1, 2]
a[0] = 100
print(b)

When the multiple assignments takes place, both a and b refer to the same object. Changing a will then change the object referenced by b . (note.nkmk.me/en/python-multi-variables-values)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: