input: Write a function to find the maximum element in a list.
  assert findMax([1, 2, 7, 4, 5]) == 7
  assert findMax([10, 20, 30, 40, 50]) == 50
  assert findMax([-1, -2, -3, -4, -5]) == -1
output: def findMax(lst):
      if not lst:
          raise ValueError("List is empty")
      max_element = lst[0]
      for element in lst:
          if element > max_element:
              max_element = element
      return max_element