Find the Highest
Finding the maximum helps you pick the best score, the highest price, or a record value. The function max_list receives a non-empty list of numbers nums. Return the largest number in the list, but do not use the built-in max function.
Примеры
Ввод
[1, 5, 3]Вывод
5Ввод
[-1, -5, -3]Вывод
-1Ввод
[7]Вывод
7Нужно реализовать
def max_list(nums: list[int]) -> int:
Теги
lists
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj sięVisible tests
1
Input
[1,5,3]Expected
52
Input
[-1,-5,-3]Expected
-13
Input
[7]Expected
74
Input
[2,2,2]Expected
25
Input
[9,1,8,2]Expected
96
Input
[3,5,1]Expected
5Focus radio
Paused · SomaFM · Fluid