n = int(input("Введите количество элементов в списке: "))
a = [float(input()) for i in range(n)]
s = 0
for i in range(n):
if a[i] > 0:
s += a[i]
print(a)
print(s)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
n = int(input("Введите количество элементов в списке: "))
a = [float(input()) for i in range(n)]
s = 0
for i in range(n):
if a[i] > 0:
s += a[i]
print(a)
print(s)