def max_iter(L): cmax = L[0] for i in L[1:]: if i > cmax: cmax = i return cmax def max_recur(L): # base case if len(L) == 1: return L[0] # general case head = L[0] max_rest = max_recur(L[1:]) if head > max_rest: return head else: return max_rest def sum_iter(L): total = 0 for i in L: total += i return total def sum_recur(L): if len(L) == 1: return L[0] return L[0] + sum_recur(L[1:])