input: Write a function to use the exponential smoothing algorithm to predict the next day's forecast temperature given the past three day's forecast temperatures. If the input list is empty, return None.
  assert predict_temperature([21, 22, 20])==21
  assert predict_temperature([25, 24, 26])==25
  assert predict_temperature([30, 32, 31])==31
  assert predict_temperature([])==None
output: def predict_temperature(past_temps):
      if not past_temps:
          return None
      alpha = 0.5
      smoothed_temp = past_temps[-1]
      for temp in past_temps[-2::-1]:
          smoothed_temp = alpha * temp + (1 - alpha) * smoothed_temp
      return smoothed_temp