title: Python interact with key and value like PHP's foreach?
body: <p>On PHP I can simple do:</p>
  
  <pre><code>foreach ($array as $key =&gt; $value) {
      // do something here
  }
  </code></pre>
  
  <p>Ok, I know that I could:</p>
  
  <pre><code>for value in arr:
      # do something here
  </code></pre>
  
  <p>but I haven't a way for know what's current key in array, in php foreach $key is current key of $array and $value is current item in $array, so my question is: exits a simple way to do this on python ?</p>
  
  <p>PS: in PHP foreach ($array as $key => $value) work with associative and non-associative arrays, then I want a way that work with lists and dicts in Python.</p>