Skip to content

Instantly share code, notes, and snippets.

@ramnes
Created May 13, 2016 08:55
Show Gist options
  • Save ramnes/220b98e23881fe9ea944b5f2fe457da9 to your computer and use it in GitHub Desktop.
Save ramnes/220b98e23881fe9ea944b5f2fe457da9 to your computer and use it in GitHub Desktop.
def str_base(number, base):
div, mod = divmod(number, len(base))
if div > 0:
return str_base(div, base) + base[mod]
return base[mod]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment