input: Write a function to find the maximum and minimum values in a given list. If the list is empty, return (None, None).
  def get_max_min(lst):
   if not lst:
    return (None, None)
   
   min_value = lst[0]
   max_value = lst[0]
   
   for i in range(1, len(lst)):
    if lst[i] > max_value:
     max_value = lst[i]
    if lst[i] < min_value:
     min_value = lst[i]
   
   return (min_value, max_value)
  
  assert get_max_min([1, 2, 3, 4, 5]) == (1, 5)
  assert get_max_min([5, 4, 3, 2, 1]) == (1, 5)
  assert get_max_min([1, 3, 5, 2, 4]) == (1, 5)
  assert get_max_min([]) == (None, None)
  assert get_max_min([7]) == (7, 7)
output: def get_max_min(lst):
   if not lst:
    return (None, None)
   
   min_value = lst[0]
   max_value = lst[0]
   
   for i in range(1, len(lst)):
    if lst[i] > max_value:
     max_value = lst[i]
    if lst[i] < min_value:
     min_value = lst[i]
   
   return (min_value, max_value)