← Back to archive

Stdle #90 · comparisons · 2026-09-04

What does this Python snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

pairs = [(1, 'b'), (2, 'a'), (1, 'a')]
print(sorted(pairs, key=lambda p: p[0]))
Comparisons
4 attempts left

Answer & explanation