a = 1
A = []
while a != 0:
a = int(input())
A.append(a)
A.pop()
print(sum(A))
Объяснение:
def func(A):
summ = 0
if a != 0:
return(func(A))
else:
for i in A:
summ += i
return summ
A =[]
print(func(A))
a = 1
A = []
while a != 0:
a = int(input())
A.append(a)
A.pop()
print(sum(A))
Объяснение:
def func(A):
summ = 0
a = int(input())
if a != 0:
A.append(a)
return(func(A))
else:
for i in A:
summ += i
return summ
A =[]
print(func(A))
Объяснение: