title: I have a function that has an offset parameter and want to loop over
body: <p>I am using a function, clientmailchimp.lists.members.all, that returns a list of dictionaries for up to 1000 members (the function has an offset parameter which is 0 by default). After getting this dictionary, I want the ID value on my subscribedmembersid list.</p>
  
  <pre><code>subscribedmembers = clientmailchimp.lists.members.all(count=1000 )   
  subscribedmembersid = [id['id'] for id in subscribedmembers['members']]
  </code></pre>
  
  <p>For results &lt;1000 this function works, but when the returned value is >1000 I would have to use the offset parameter offset=1000 to get the second chunk of the list. How can I do this with a While loop that appends the chunks on an empty list? </p>
  
  <p>I tried something like this but not sure im doing the loop correctly</p>
  
  <pre><code>subscribedmemberslist = []
  offset = 0
  
  while len(subscribedmembersid) &gt; 1000 :
      subscribedmembers = clientmailchimp.lists.members.all(count=1000, offset=offset)
      subscribedmembersid = [id['id'] for id in subscribedmembers['members']]
      offset =+ 1000
      subscribedmemberslist.append(subscribedmembersid)
  </code></pre>
  
  <p>I just expect a list of all the members all together.</p>