← Back to challenges

Iterable Unpacking

PythonMediumlanguage_fundamentalsarrays

Instructions

There is an easy way to assign to array values to the nth index by using the Rest element.

head, tail = [1, 2, 3, 4]

print(head) ➞ 1
print(tail) ➞ 2

But how could I make tail = [2, 3, 4] instead of tail = 2? Add something into the code and make this happen.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is the Word Singular or Plural?