Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Restricted sum solution in Clear category for Restricted Sum by Seaclaid
def dodawanie(lista,j,res):
res=res+lista[j]
j+=1
if j==len(lista):
return res
res=dodawanie(lista,j,res)
return res
def checkio(data):
odp=0
i=0
odp=dodawanie(data,i,odp)
print(odp)
return odp
if __name__ == '__main__':
assert checkio([1, 2, 3]) == 6
assert checkio([2, 2, 2, 2, 2, 2]) == 12
Jan. 14, 2017