python 36以内的进制转换
36以内的进制转换都可以这么写
def baseN(num,b):
return ((num ==0) and "0") or baseN(num//b,b).lstrip("0")+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[num%b]
本文来自博客园,作者:ivanlee717,转载请注明原文链接:https://www.cnblogs.com/ivanlee717/p/17356599.html
36以内的进制转换都可以这么写
def baseN(num,b):
return ((num ==0) and "0") or baseN(num//b,b).lstrip("0")+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[num%b]
本文来自博客园,作者:ivanlee717,转载请注明原文链接:https://www.cnblogs.com/ivanlee717/p/17356599.html