← Back to archive

Stdle #140 · iteration · 2026-10-24

What does this Ruby snippet output?

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

evens, odds = [1, 2, 3, 4, 5, 6].partition { |n| n.even? }
puts evens.inspect
puts odds.inspect
Iteration
2 lines
4 attempts left

Answer & explanation