Last active
August 19, 2016 13:51
-
-
Save mebusw/7a0df8c359381931abd0 to your computer and use it in GitHub Desktop.
integer to N-ary 整数转为N进制
This file contains 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 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