promptdojo_

Write a function find_max(items) that returns the largest number in a list. Inside the loop, print each item and the current best so far in the format seen X, best Y. Then call it on [3, 7, 2, 9, 4] and print the result.

Expected output:

seen 3, best 3
seen 7, best 7
seen 2, best 7
seen 9, best 9
seen 4, best 9
9

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.