На pythonList = [11, 20, 31, 40, 51]
List2 = []
min_element = List[0]
max_element = List[0]
for num in List:
if num < min_element:
min_element = num
if num > max_element:
max_element = num
sum_of_min_max = min_element + max_element
List2.append(sum_of_min_max)
print(List2)
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
На python
List = [11, 20, 31, 40, 51]
List2 = []
min_element = List[0]
max_element = List[0]
for num in List:
if num < min_element:
min_element = num
if num > max_element:
max_element = num
sum_of_min_max = min_element + max_element
List2.append(sum_of_min_max)
print(List2)