...

/

Puzzle 17: Explanation

Puzzle 17: Explanation

Let’s find out how multiple assignments and unpacking works in Python.

We'll cover the following...

Let’s try it!

Try executing the code below to verify the result:

Press + to interact
avengers = ['Bruce', 'Carol', 'Natasha', 'Tony']
idx = 3
avengers[idx], idx = 'Peter', 2
print(avengers)

Explanation

In this exercise, we’re doing multiple ...