Created
March 8, 2014 04:43
-
-
Save cocuh/9425478 to your computer and use it in GitHub Desktop.
勉強しながら書いたもの
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
# 奇数変換 16進数まで対応 | |
# f(10,10) = '10'(10) | |
# f(10,8) = '12'(8) | |
# f(10,16) = 'A'(16) | |
f=lambda x,n,p='':x and f(x//n,n,'%X'%(x%n)+p)or p | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment