Python enumerate, zip and sorted Quiz

This Python quiz checks how well you know enumerate(), zip() and sorted(), the built-ins that make loops shorter and clearer. You will predict output, pick the idiomatic loop and spot the difference between sorted() and list.sort().

Easy 10 questions ~5 minutes Pass at 80% Python 3.12

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

What does this print?

print(list(enumerate("abc", start=1)))
Show the answer

B. [(1, 'a'), (2, 'b'), (3, 'c')] enumerate() yields (index, item) pairs, index first. start=1 only changes where counting begins, so the first pair is (1, 'a').

What this quiz covers

  • Counting with enumerate() and its start argument
  • Pairing lists with zip() and what happens when lengths differ
  • sorted() vs list.sort()
  • Sorting with key= and reverse=True
  • Unzipping pairs with zip(*pairs)

Questions people ask

Do I need an account?

No. Anyone can play. Sign in to keep your XP, streak, badges and history.

Which Python version?

Python 3.12. Every question about output was checked by running the code.

Can I retake it?

Yes. Your best score is kept, and the questions and answers are shuffled each time.