Ответ:
from random import randint
arr = []
for i in range(0, 10):
arr.append(randint(1, 176))
arr2 = []
for i in arr:
if i % 2 != 0:
arr2.append(i)
print("Массив:", str(list(arr)).replace("[", "").replace("]", "") + ".")
print("Сумма нечетных элементов:", str(sum(arr2)) + ".")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
from random import randint
arr = []
for i in range(0, 10):
arr.append(randint(1, 176))
arr2 = []
for i in arr:
if i % 2 != 0:
arr2.append(i)
print("Массив:", str(list(arr)).replace("[", "").replace("]", "") + ".")
print("Сумма нечетных элементов:", str(sum(arr2)) + ".")