input: Write a function to predict the next day's forecasted temperature using the exponential smoothing algorithm given the past three day's forecasted temperatures. Use a confidence value of 0.5 and initialize the prediction with the last temperature in the list. If the input list is not of length 3, return None.
  
  def predict_temperature(temperature_list):
      if len(temperature_list) != 3:
          return None
      alpha = 0.5 # Confidence value
      predicted_temperature = temperature_list[-1] # Initializing prediction
      for temperature in temperature_list[:-1]:
          predicted_temperature = alpha*temperature + (1-alpha)*predicted_temperature
      return predicted_temperature
  
  assert predict_temperature([21, 22, 20])==21.0
  assert predict_temperature([23, 24, 25])==24.5
  assert predict_temperature([18, 19, 17])==18.0
  assert predict_temperature([15, 16, 14])==15.0
  assert predict_temperature([20, 21, 22, 23])==None
output: def predict_temperature(temperature_list):
      if len(temperature_list) != 3:
          return None
      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