code: def generate_random_nhs_number() -> int:
      
      check_digit = 10  # NHS numbers with this check digit are all invalid
      while check_digit == 10:
          digits = [random.randint(1, 9)]  # don't start with a zero
          digits.extend([random.randint(0, 9) for _ in range(8)])
          # ... length now 9
          check_digit = nhs_check_digit(digits)
      # noinspection PyUnboundLocalVariable
      digits.append(check_digit)
      return int("".join([str(d) for d in digits]))
docs: Returns a random valid NHS number, as an ``int``.