Picking the smallest value in a list using recursion This is the code I wrote in order to find the smallest value in a list using recursion.However I feel like there would be a better way to do this?

def minimum(lst):
    """
    parameters : lst of type list
    return : the value of the smallest element in the lst
    """
    if len(lst) == 1:
        return lst[0]

    if lst[0] &lt; lst[1]:
        lst.append(lst[0])
        return(minimum(lst[1:]))
    else:
        return(minimum(lst[1:]))
Instead of adding back to the list to maintain an accumulator (the current minimum in this case), I'd just add a second parameter to the function, and allow it to default to None:

# acc, the accumulator, represents the current lowest found
def my_minimum(lst, acc = None):
   if not lst: # If the list is empty, return the current lowest
      return acc

   # Head is the first element, and the tail is the rest of the list
   # This is a common pattern when recursively iterating a list
   head, *tail = lst

   # The first time this is run, "not acc" fails, and it defaults to head
   new_acc = head if not acc or head &lt; acc else acc

   return my_minimum(tail, new_acc)

lst = [2, 3, 4, 9, 2, -2]

print(my_minimum(lst))
-2


Note though that head, *tail = lst, is quite inefficient, as it requires making an entire copy to construct tail. I'm using it here for brevity.