title: Python for loop access two elements at a time
body: <p>I'm adding into the value section of a dictionary a name and the value of properties of an item: </p>
  
  <pre><code>value+=child.get('name') + '\t' + child.text + '\t' 
  </code></pre>
  
  <p>Each piece of text is separated by a tab. So then when I process this value string later, I split on the tabs and have a for loop to iterate over the list.</p>
  
  <p>How can I access both the name and value in the for loop. As for each property I want to get the name and value in one go and write it to a file. Currently the list looks like:</p>
  
  <p>[a,b,a,b,a,b,a,b]</p>
  
  <p>and for each a,b I want to write:</p>
  
  <p>'&lt;' tag name=a '>' b '&lt;' /tag '>'</p>