input: Write a function to predict the next day's forecast temperature using the exponential smoothing algorithm given the past three days' forecast temperatures. If the given list is empty, return 0.
  assert predict_temperature([21, 22, 20])==21.0
  assert predict_temperature([15, 18, 17])==17.5
  assert predict_temperature([25, 24, 26])==25.0
  assert predict_temperature([])==0
  assert predict_temperature([10, 10, 10])==10.0
  
  def predict_temperature(temperature_list):
      if not temperature_list:
          return 0
      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
output: def predict_temperature(temperature_list):
      if not temperature_list:
          return 0
      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