Polydivisible Numbers

Python

def polydivisible(x):
    isPoly = True
    for numDigits in range(1, len(str(x)) + 1):
        num = int(str(x)[:numDigits])
        if num % numDigits is not 0:
            isPoly = False
            break
    return isPoly

Tags

  1. python (Private)
  2. 7-kyu (Private)
  3. codewars (Private)
  4. answer (Private)