Skip to content

Instantly share code, notes, and snippets.

@wholevinski
Created August 17, 2015 17:55
Show Gist options
  • Save wholevinski/26993774f670f4fa0907 to your computer and use it in GitHub Desktop.
Save wholevinski/26993774f670f4fa0907 to your computer and use it in GitHub Desktop.
def get_digits(input):
digits = []
exponent = 1
while True:
mod_result = (input % (10 ** exponent))
digit = mod_result / (10 ** (exponent - 1))
digits.append(digit)
if mod_result == input:
break
exponent += 1
return digits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment