← Back to archive

Stdle #27 · iteration · 2026-07-03

What does this Rust snippet output?

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

fn main() {
let names = ["amy", "bob", "cal"];
let ages = [30, 25];
for (n, a) in names.iter().zip(&ages) {
println!("{}={}", n, a);
}
}
Iteration
2 lines
4 attempts left

Answer & explanation