input: 
  def min_max(arr):
      """ Returns an array containing the smallest and the greatest value in the given array.
      >>> min_max([3, 4, 2, 8, 15, 6])
      [2, 15]
      >>> min_max([-1, 0, 10, -5, 20])
      [-5, 20]
      >>> min_max([7])
      [7, 7]
      """
      min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]
  
  result = min_max([3, 4, 2, 8, 15, 6])
  print(result)
  
output:     
      min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]
  