SolveWithPython

Challenge 3: Find the Largest Number in a List

You’ll identify the maximum value in a list of numbers.
This is a common foundational task.
Estimated time: 10 minutes | Difficulty: Beginner

Problem

Return the largest number from a list.

Inputs

  • numbers: list[int]

Output

Return the maximum integer.

Examples

Input

[3, 7, 2, 9]

Output

9

Constraints

  • List contains at least one number

Requirements

  • Function name: max_number(numbers: list[int]) -> int

Python Challenge 3 Solution Find the Largest Number in the List

Explanation

  • Python’s built-in max() efficiently finds the largest value
  • Time complexity: O(n)
  • Space complexity: O(1)

Python Challenge 3 Test Find the Largest Number in the List

You can use the following tests above to verify your solution locally.

🔗 View reference solution on GitHub
(After you’ve tried the challenge)

Nice work!

You’ve completed this challenge. The best way to improve your Python skills is to keep practicing while the concept is fresh.

👉 Next Challenge → Count Character Frequency

Want more practical Python challenges?
Subscribe to the Solve With Python newsletter and get new problems delivered to your inbox.