title: How to dereference an object in Python?
body: <p>I have a function with returns a tuple:</p>
  
  <pre><code>def gradiant(params, data):
      Q1 = params[0]
      Q2 = params[1]
      dQ1 = sum(2*(y_i - Q1*x_i - Q2)*(x_i) for x_i, y_i in data)
      dQ2 = sum(-2*(y-i - Q1*x_i - Q2) for x_i, y_i in data)
      return (dQ1, dQ2)
  </code></pre>
  
  <p>I'm trying to print the returned values:</p>
  
  <pre><code>grad = gradiant(params, Data)
  for x in grad: print(x)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>&lt;generator object &lt;genexpr&gt; at 0x7fdfe009adc0&gt;
  &lt;generator object &lt;genexpr&gt; at 0x7fdfe009a5f0&gt;
  </code></pre>
  
  <p>How do I get to print the integer values?</p>