a, b = 1, 2 # swap without a temporary a, b = b, a print(a, b) # star grabs the middle first, *rest = [1, 2, 3, 4] print(first, rest)
assign several names at once