title: How to create a dict equivalent in Python from Perl hash?
body: <p>I'm new to python, and can't get my head around dict hashes.</p>
  
  <p>Here's my perl code:</p>
  
  <pre><code>my %sites;
  
  foreach (@indexes) {
         push @{$sites{$1}}, $_ if (/.*\.(.*)/);
  }
  
  foreach my $sites (keys %sites)
  {
          @devices = @{$sites{$sites}};
          #Do stuff
  </code></pre>
  
  <p>How do I do the same in Python?</p>