input: Write a function to predict the next day's forecast temperature using the exponential smoothing algorithm given the past three day's forecast temperatures. Return the predicted temperature.
  assert predict_temperature([21, 22, 20])==21.5
  assert predict_temperature([19, 20, 21])==19.75
  assert predict_temperature([18, 19, 20])==19.0
  assert predict_temperature([22, 21, 20])==21.0
  assert predict_temperature([20, 20, 20])==20.0
output: def predict_temperature(past_temps):
      alpha = 0.5
      smoothed_temp = past_temps[2]
      for i in range(1, 3):
          smoothed_temp = alpha * past_temps[2-i] + (1 - alpha) * smoothed_temp
      return smoothed_temp