code: def checksum(digits, scale):
      
      chk_nbr = 11 - (sum(map(operator.mul, digits, scale)) % 11)
      if chk_nbr == 11:
          return 0
      return chk_nbr
docs: Calculate checksum of Norwegian personal identity code.
  
      Checksum is calculated with "Module 11" method using a scale.
      The digits of the personal code are multiplied by the corresponding
      number in the scale and summed;
      if remainder of module 11 of the sum is less than 10, checksum is the
      remainder.
      If remainder is 0, the checksum is 0.
  
      https://no.wikipedia.org/wiki/F%C3%B8dselsnummer