title: Python AssertionError
body: <p>When I check the ISBN(DIGIT) with my code : check_digit_13(2000003294107)</p>
  
  <pre><code>def check_digit_13(isbn):
      assert len(isbn) == 12
      sum = 0
      for i in range(len(isbn)):
          c = int(isbn[i])
          if i % 2: w = 3
          else: w = 1
          sum += w * c
      r = 10 - (sum % 10)
      if r == 10: return '0'
      else: return str(r)
  </code></pre>
  
  <p>The Error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "parser.py", line 16, in &lt;module&gt;
      lk.run(document)
    File "/data/www/crons/lk/parser.py", line 33, in run
      field = lkmapper.all(row, document)
    File "/data/www/crons/mappers/lk.py", line 5, in all
      print isbn.check_digit_13(field[0])
    File "/data/www/crons/libs/isbn.py", line 13, in check_digit_13
      assert len(isbn) == 12
  AssertionError
  </code></pre>