CodeMIRAI
0 XP

Largest of a list

Easy +30 XP Solved

Read a line of whole numbers separated by spaces and print the largest one.

Try it without using the built-in max() function.

Input
3 9 2 7
Expected output
9
Input
-5 -1 -9
Expected output
-1
Show a hint

Start with the first number as the biggest so far, then compare every other number with it.

Show a solution
Python
Loading the editor…
Run the tests to check your solution.