Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- num = int(input())
- min_num = sys.maxsize
- max_num = -sys.maxsize
- for i in range(num):
- n = int(input())
- if n < min_num:
- min_num = n
- if n > max_num:
- max_num = n
- print(f'Max number: {max_num}')
- print(f'Min number: {min_num}')
- Фундаменталс решение c list():
- num = int(input())
- numbers = list()
- for i in range(num):
- numbers.append(int(input()))
- print(f'Max number: {max(numbers)}\nMin number: {min(numbers)}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement