Created
September 18, 2018 12:27
-
-
Save ofx/e457795a7aef2dd3ffc2f2fb8ff5caeb 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 convert(x, N): | |
y = x % N | |
x = x // N | |
if (x == 0): | |
return [y] | |
else: | |
return convert(x, N) + [y] | |
print(convert(10001, 16)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment