Sum, Min, Max
Completed
Read a line of integers into a list. Print the count, sum, smallest and largest, one per line.
Input
One line of space-separated integers.
Output
Four lines.
Example
Input
3 9 -2 7
Output
4 17 -2 9
Editor
Python
Hints
list(map(int, input().split())) builds a list of ints.
len, sum, min and max all work on lists.
Solution explanation
The built-in functions save you from writing a loop for these common questions.
Show solution
nums = list(map(int, input().split()))
print(len(nums))
print(sum(nums))
print(min(nums))
print(max(nums))