code: def _toIntList(numstr, acceptX=0):
      
      res = []
      # Converting and removing invalid characters
      for i in numstr:
          if i in string.digits and i not in string.letters:
              res.append(int(i))
  
      # Converting control number into ISBN
      if acceptX and (numstr[-1] in 'Xx'):
          res.append(10)
      return res
docs: Convert ans string to a list removing all invalid characters.
      Receive: a string as a number