Advertisement
Spocoman

07. Min Max and Sum

Jan 28th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. numbers = [int(i) for i in input().split()]
  2.  
  3.  
  4. def min_num():
  5.     return min(numbers)
  6.  
  7.  
  8. def max_num():
  9.     return max(numbers)
  10.  
  11.  
  12. def sum_num():
  13.     return sum(numbers)
  14.  
  15.  
  16. print(f'The minimum number is {min_num()}\n'
  17.       f'The maximum number is {max_num()}\n'
  18.       f'The sum number is: {sum_num()}')
  19.  
  20.  
  21. Или:
  22.  
  23. numbers = [int(i) for i in input().split()]
  24.  
  25.  
  26. def result():
  27.     return f'The minimum number is {min(numbers)}\n' \
  28.            f'The maximum number is {max(numbers)}\n' \
  29.            f'The sum number is: {sum(numbers)}'
  30.  
  31.  
  32. print(result())
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement