Finished existing ipython solutions to python. Ready to continue in pure python.
This commit is contained in:
@@ -196,7 +196,13 @@ def permutations(iterable):
|
||||
|
||||
|
||||
def gcd(a, b):
|
||||
""" Returns the greatest commond divisor of a and b. """
|
||||
if b == 0:
|
||||
return a
|
||||
return gcd(b, a % b)
|
||||
while a % b != 0:
|
||||
a, b = b, a % b
|
||||
return b
|
||||
|
||||
|
||||
def get_digit_count(n):
|
||||
"""
|
||||
Returns the number of digits for n.
|
||||
"""
|
||||
return len(str(n))
|
||||
|
||||
Reference in New Issue
Block a user