Finished existing ipython solutions to python. Ready to continue in pure python.

This commit is contained in:
2019-07-18 14:23:44 -04:00
parent c624e6ac52
commit 45e0cd8a78
13 changed files with 425 additions and 25 deletions

View File

@@ -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))