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 #240
a, b, *c = range(5)
print(c)
In Python 3.0, the * operator was added to the multiple assignment syntax, allowing to capture remaining items after an unpacking into a list. (treyhunner.com/2018/03/tuple-unpacking-improves-python-co...)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) July 6, 2020
a, b, *c = range(5)
print(*c)
0 1 2 3 4
2 3 4
It will throw a ValueError error.
0 1 2#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: