Python · Lesson 5.6 · Pro

enumerate and zip

Loop with a counter, or walk through two lists side by side.

In this lesson

  1. enumerate: the position and the item
  2. zip: two lists at once
  3. Compare neighbours with zip
  4. Find the position of the best