File: LP6E/Chapter19/mysum.py

def mysum(L):
    if not L:
        return 0
    else:
        return L[0] + mysum(L[1:])       # Call myself recursively



[Home page] Books Code Blog Python Author Train Find ©M.Lutz