title: How to count the number of zeros in Python?
body: <p>My code is currently written as:</p>
  
  <pre><code>convert = {0:0,1:1,2:2,3:3,4:0,5:1,6:2,7:1}
  rows = [[convert[random.randint(0,7)] for _ in range(5)] for _ in range(5)]
  numgood = 25 - rows.count(0)
  
  print numgood
  &gt;&gt; 25
  </code></pre>
  
  <p>It always comes out as 25, so it's not just that rows contains no 0's.</p>