title: Iterating through a dictionary that starts at the first key value each iteration
body: <p>I have a dictionary that contains usernames in the key, and dates in the value. Because I cannot sort the dictionary alphabetically, I want to iterate through the dictionary keys (username) to match an item in a separate alphabetical ordered list that holds all the usernames and then print the associated value (date) in a spreadsheet. The problem I am running into is that when it is iterating through the dictionary, it doesn't start at the beginning dictionary key each time and the next item to match in the list has already been iterated through in the dictionary. Is there a specific iteration tool that will start at the beginning each time?</p>
  
  <p>Code I have so far:</p>
  
  <pre><code>x=0
  nd=0
  for k, v in namedatedict.items():
      if k == usernamelist[x]:
          sh1.write(nd, col3_name, v)
          x += 1
          nd += 1
  </code></pre>
  
  <p>To give you some background on what I am doing, I am trying to find the date that matches the specific username and print it next to the associated username in a spreadsheet. There may be a completely different way to iterate through these value but this is the only way I could think of. Any help/guidance would be appreciated.</p>