title: To understand: From PHP Array to Python?
body: <p>This is Common task In PHP and other programming languages.I moved from PHP developer.
  I want to make sure with this collections.
  Anyone have who good in python please help me to understand clearly .
  This is my collections from PHP code.</p>
  
  <pre><code>&lt;?php
  $php = array(1,2,3,4,5,6,7,8,9,10);
  for ($i = 0; $i &lt; 10 ; $i ++)
  echo $php[$i]."&lt;br&gt;";
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  
  for ($i = 0; $i &lt; 10 ; $i ++)
  echo $php[$i] = $i +1 ;
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $php = array(1,2,3,4,5,6,7,8,9,10);
  foreach ($php as $value)
  echo $value."&lt;br&gt;";
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $arr = array(1, 2, 3, 4);
  foreach ($arr as &amp;$value) {
      $value = $value * 2;
  }
  // $arr is now array(2, 4, 6, 8)
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $arr = array("mot"=&gt;"one", "hai"=&gt;"two","ba"=&gt; "three");
  foreach ($arr as $key =&gt; $value) {
      echo "Key: $key; Value: $value&lt;br /&gt;\n";
  }
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $arr = array("one", "two","three");
  while (list($key, $value) = each($arr)) {
      echo "Key: $key; Value: $value&lt;br /&gt;\n";
  }
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $arr = array("one", "two","three");
  while ($element = each($arr)) {
      echo "Key: $element['key']; Value: $element['value']&lt;br /&gt;\n";
  }
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>
  
  <pre><code>&lt;?php
  $products = array( array("ITL","INTEL","HARD"),
                          array("MIR", "MICROSOFT","SOFT"),
                          array("Py4C", "pythonkhmer.wordpress.com","TUTORIAL")
                           );
  for ($row = 0; $row &lt; 3; $row++)
  {
      for ($col = 0; $col &lt;3; $col++)
          {
           echo "|".$products[$row][$col];
           }
  echo "&lt;br&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>=>What is in Python?</p>