title: product of digits as a single-digit number
body: <p>I am trying to compute the product of non-zero digits,
  until the result is a single-digit number. For example, the number 512983 is 2, because 5×1×2×9×8×3 = 2160 and 2×1×6 = 12 (note the omission of the zero digit) and 1 × 2 = 2. But every time I run this I only get 0 </p>
  
  <pre><code>    def prod_digits(n):
          a = 1
          for each in str(n):
              a = a * int(each)
          return a
  
      prod_digits(123)
  </code></pre>