title: Iterating Over Dictionary Key Values Corresponding to List in Python
body: <p>Working in Python 2.7. I have a dictionary with team names as the keys and the amount of runs scored and allowed for each team as the value list:</p>
  
  <pre><code>NL_East = {'Phillies': [645, 469], 'Braves': [599, 548], 'Mets': [653, 672]}
  </code></pre>
  
  <p>I would like to be able to feed the dictionary into a function and iterate over each team (the keys).</p>
  
  <p>Here's the code I'm using. Right now, I can only go team by team. How would I iterate over each team and print the expected win_percentage for each team?</p>
  
  <pre><code>def Pythag(league):
      runs_scored = float(league['Phillies'][0])
      runs_allowed = float(league['Phillies'][1])
      win_percentage = round((runs_scored**2)/((runs_scored**2)+(runs_allowed**2))*1000)
      print win_percentage
  </code></pre>
  
  <p>Thanks for any help.</p>