numbers = (38, 20, 5, 40, 13)
# Вариант 1
print('Max:', max(numbers))
print('Min:', min(numbers))
print()
# Вариант 2
MAX = numbers[0]
MIN = numbers[0]
for num in numbers:
if num < MIN:
MIN = num
if num > MAX:
MAX = num
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
numbers = (38, 20, 5, 40, 13)
# Вариант 1
print('Max:', max(numbers))
print('Min:', min(numbers))
print()
# Вариант 2
MAX = numbers[0]
MIN = numbers[0]
for num in numbers:
if num < MIN:
MIN = num
if num > MAX:
MAX = num
print('Max:', max(numbers))
print('Min:', min(numbers))