title: How to store values from a function in python?
body: <p>I have a function:</p>
  
  <pre><code>def get_val():
      for a in b:
          c = b['values']
          print (c)
  </code></pre>
  
  <p>When I call the function <code>get_val()</code>, I get the result which is a long list of values with numbering up to 1000.  <code>type(c)</code> is <code>float</code>.</p>
  
  <p>Now I want to store this result from the function into a variable e. I tried using <code>return c</code> instead of <code>print(c)</code> </p>
  
  <p>Return function is not convenient because it will only return a line instead of the whole 1000.</p>