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. The function should take a list of temperatures as input and return the predicted temperature.
  
  
  def predict_temperature(temperature_list):
      alpha = 0.5  # Smoothing factor
      predicted_temperature = temperature_list[-1]  # Initialize prediction with the last temperature
      for temperature in temperature_list[:-1]:
          predicted_temperature = alpha * temperature + (1 - alpha) * predicted_temperature
      return predicted_temperature
  
  # Test cases
  assert predict_temperature([21, 22, 20]) == 20.5
  assert predict_temperature([10, 15, 12]) == 12.5
  assert predict_temperature([5, 7, 6]) == 6.25
  
output: def predict_temperature(temperature_list):
      alpha = 0.5  # Smoothing factor
      predicted_temperature = temperature_list[-1]  # Initialize prediction with the last temperature
      for temperature in temperature_list[:-1]:
          predicted_temperature = alpha * temperature + (1 - alpha) * predicted_temperature
      return predicted_temperature