""" max.py return the max of a list using recursion """ def maximum(the_list): if len(the_list) == 1: return the_list[0] else: first = the_list[0] biggest_in_rest = maximum(the_list[1:]) if first > biggest_in_rest: return first else: return biggest_in_rest def main(): sample = [1, 10, 5, 3] biggest = maximum(sample) print("biggest of {} is {}".format(sample, biggest)) main()