Lists · Beginner · 45 XP · about 5 min
Write a function called find_max(numbers) that returns the largest number in a list.
Challenge: Try to solve this without using Python's built-in max() function!
find_max([1, 5, 3, 9, 2]) # Returns 9 find_max([-1, -5, -3]) # Returns -1 find_max([42]) # Returns 42
Ready?
Accept the challenge to start writing. A small timer counts the time this page is in view.
Output appears here.