Untitled
unknown
python
4 years ago
367 B
8
Indexable
def a(n):
xa=0
for i in range(len(n)):
xa+=n[i]
return xa
def b(n):
xb=0
while len(n)!=0:
xb+=n[0]
n.pop(0)
return xb
def c(n):
if len(n)==0:
return 0
else:
k=n[0]
n.pop(0)
return c(n)+k
n=list(map(int,input().split(' ')))
print(a(n))
print(b(n))
print(c(n))Editor is loading...