spock
6/11/2017 - 11:27 AM

Capturing multiple list args

Capturing multiple list args

first, *rest, last = ['A', 'B', 'C', 'D', 'E']  # note: *rest
first == 'A'
rest == 'B', 'C', 'D'  # all values in between captured
last == 'E'