Created
May 13, 2016 08:55
-
-
Save ramnes/220b98e23881fe9ea944b5f2fe457da9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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