title: how to for loop with two conditions with a list in python
body: <p>Currently I have this</p>
  
  <pre><code>for device in variables['devices']:
      do something
  </code></pre>
  
  <p>I want to run the above loop for only 10 times can I do something like this?</p>
  
  <pre><code>for device in variables['variable'] and range(1,10):
       do something
  </code></pre>
  
  <p>and again want to loop again from 11, till end of list in <code>variables['devices']</code>
  How do I approach this?</p>