title: TypeError: cannot unpack non-iterable NoneType object when trying to run a function
body: <p>I am getting an error that "TypeError: cannot unpack non-iterable NoneType object" at last line of my code. Could you please help me with that?</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  #Weights (lb)
  Measured = [158, 164.2, 160.3, 159.9, 162.1, 164.6,
  169.6, 167.4, 166.4, 171, 171.2, 172.6]
  
  #time step of 1 day
  time_step = 1
  
  #kalman Gain
  Kg = 4/10
  
  def predict_using_gain_guess(updated_estimate, gain_rate):
      estimates, predictions = [updated_estimate], []
  
      for z in Measured:
          #predict new position based on hypothesis that we are gaining 1lb every day
          prediction_hp = updated_estimate + gain_rate*time_step
  
          #update filter
          updated_estimate = prediction_hp + Kg * (z - prediction_hp)
  
          #save
          estimates.append(updated_estimate)
          predictions.append(prediction_hp)
  
  initial_estimate = 160
  estimates, predictions = predict_using_gain_guess(
      updated_estimate=initial_estimate, gain_rate=1)
  </code></pre>