Exercise 2 solution Cost: items[1:] builds a new list of length n-1, then n-2, and so on, so the recursion copies about n*n/2 references in total, far more than the n additions the sum needs. (It also hits Python's recursion limit for long lists.) Rewrite with an index, no slices: def total(items, i=0): if i == len(items): return 0 return items[i] + total(items, i + 1) Check: def total_slicing(items): return 0 if not items else items[0] + total_slicing(items[1:]) data = list(range(500)) print(total_slicing(data), total(data)) Output: 124750 124750 Both agree; the second makes no copies. (A plain loop or sum() is better still, and avoids deep recursion.)