The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #316
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)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) November 5, 2020
a = b = [0, 1, 2]
a[0] = 100
print(b)
100
[100, 1, 2]
[0, 1, 2]
0#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: