$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #238

What is the output?

a, *b, c = [1, 2, 3, 4, 5]
print(b)
  1. [2, 3, 4]
  2. [2, 3]
  3. (2, 3, 4)
  4. [1, 2, 3, 4]
The starred name collects everything the other targets do not take, always as a list: a gets 1, c gets 5, b gets [2, 3, 4].
Play Problem Solving ▸