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. The function should take a list of temperatures as input and return the predicted temperature. If the list is empty, the function should return 0.
  
  def predict_temperature(temperature_list):
      if not temperature_list:
          return 0
      alpha = 0.5 # Confidence value
      predicted_temperature = temperature_list[-1] # Initializing prediction
      for temperature in reversed(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 reversed(temperature_list[:-1]):
          predicted_temperature = alpha * temperature + (1 - alpha) * predicted_temperature
      return predicted_temperature