Ver Fonte

Moved some common functions to 'utils'

Taddeus Kroes há 13 anos atrás
pai
commit
adfe635574
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 1 2
      problem92.py
  2. 3 0
      utils.py

+ 1 - 2
problem92.py

@@ -1,6 +1,5 @@
 #!/usr/bin/env python
-def digits(n):
-    return [n] if n < 10 else digits(n / 10) + [n % 10]
+from utils import digits
 
 def quad(n):
     return n * n

+ 3 - 0
utils.py

@@ -1,3 +1,6 @@
+def digits(n):
+    return [n] if n < 10 else digits(n / 10) + [n % 10]
+
 def _gcd(a, b):
     while b:
         a, b = b, a % b