Skip to content

Instantly share code, notes, and snippets.

@ofx
Created September 18, 2018 12:27
Show Gist options
  • Save ofx/e457795a7aef2dd3ffc2f2fb8ff5caeb to your computer and use it in GitHub Desktop.
Save ofx/e457795a7aef2dd3ffc2f2fb8ff5caeb to your computer and use it in GitHub Desktop.
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