input: Write a function to implement the exponential smoothing algorithm to predict the next day's forecast temperature given the past three day's forecast temperatures. Use a confidence value alpha of 0.5. If the list is empty, return None.
  def predict_temperature(temperature_list):
      if not temperature_list:
          return None
      alpha = 0.5 
      predicted_temperature = temperature_list[-1]  
      for temperature in temperature_list[:-1]:
          predicted_temperature = alpha*temperature + (1-alpha)*predicted_temperature
      return predicted_temperature
  
  assert predict_temperature([21, 22, 20]) == 20.75
  assert predict_temperature([20, 21, 22]) == 21.25
  assert predict_temperature([22, 20, 21]) == 20.75
  assert predict_temperature([21, 22, 23]) == 22.25
  assert predict_temperature([]) == None
output: def predict_temperature(temperature_list):
      if not temperature_list:
          return None
      alpha = 0.5 
      predicted_temperature = temperature_list[-1]  
      for temperature in temperature_list[:-1]:
          predicted_temperature = alpha*temperature + (1-alpha)*predicted_temperature
      return predicted_temperature