title: How to unpack key,value pairs in python?
body: <p>I'm trying to explore the Algorithmia image taggers in python.</p>
  
  <pre><code>client.algo("deeplearning/IllustrationTagger/0.2.5")
  client.algo("deeplearning/InceptionNet/1.0.3")
  </code></pre>
  
  <p>But that's not quite relevant to this question, as it applies to dictionaries in general.</p>
  
  <pre><code>for dict in dictList:
      print(dict)
  </code></pre>
  
  <p>And this is the output:</p>
  
  <blockquote>
    <p>//{'safe': 0.9950032234191896}</p>
    
    <p>//{'questionable': 0.004409242421388626}</p>
    
    <p>//{'explicit': 0.00011681715113809332}</p>
  </blockquote>
  
  <p>I can access the key just fine:</p>
  
  <pre><code>for dict in dictList:
      for key in dict:
          print(key)
  </code></pre>
  
  <blockquote>
    <p>//safe</p>
    
    <p>//questionable</p>
    
    <p>//explicit</p>
  </blockquote>
  
  <p>But when I'm trying to unpack both the key and the value:</p>
  
  <pre><code>for dict in dictList:
      for key, value in dict:
          print(key)
          print(value)
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>for key, value in dict:<br>
    ValueError: too many values to unpack (expected 2)</p>
  </blockquote>
  
  <p>How can I access both the key and the value ?</p>
  
  <p>EDIT: I've renamed obj and array to dict and list not to confuse with Javascript notation.</p>