Using min, max, and sum with Numbers in Lists

preview_player
Показать описание
This video explains how to use min(), max() and sum() functions with the Numbers Lists in Python Language...

Python min() Function

The min() function returns the item with the lowest value, or the item with the lowest value in an iterable.

Python sum() Function

The sum() function returns a number, the sum of all items in an iterable.

Python max() Function

The max() function returns the item with the highest value, or the item with the highest value in an iterable

Example Code:
numbers = [1,2,3,4,5,6,7,8,9,10]
print("Minimum number is: ",str(min(numbers)))
print("maximum number is: ",str(max(numbers)))
print("Sum is: ",str(sum(numbers)))

Code output:-
Minimum number is: 1
maximum number is: 10
Sum is: 55
Рекомендации по теме
join shbcf.ru