Skip to content

Instantly share code, notes, and snippets.

@mebusw
Last active August 19, 2016 13:51
Show Gist options
  • Save mebusw/7a0df8c359381931abd0 to your computer and use it in GitHub Desktop.
Save mebusw/7a0df8c359381931abd0 to your computer and use it in GitHub Desktop.
integer to N-ary 整数转为N进制
def xf(x,y):
l=[]
while True:
if x==0:
break
else:
z,h=divmod(x,y)
x=z
l.insert(0,h)
return ''.join(map(str, l))
pr=xf(703,26)
print pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment