title: Print Python deque items one at a time with all items before it
body: <p>I have created the deque <code>h = collections.deque()</code> and appended numbers 1-10 to it and enclosed it the function <code>print(h)</code> in the user defined function <code>Numbers_deque()</code>. Specifically, I did this:</p>
  
  <pre><code>import collections
  
  
  def Numbers_deque():
      h = collections.deque()
      j = (1,2,3,4,5,6,7,8,9,10)
      h.append(j)
      print(h)
  
  Numbers_deque()
  </code></pre>
  
  <p>What I would like to know is, how would I print out the deque items increasing one at a time, and each time it also prints out all the items before it? For example, each time <code>Numbers_deque</code> is called, the first time I want it to print <code>deque([1])</code>, then the second time it should print <code>deque([1,2])</code>, then the third time it should print <code>deque([1,2,3])</code> so on so forth. How would I do this?</p>