10进制转换36进制
def transform36(n): res = [] while n: res.append(n%36) n = n//36 out = [] for rr in res[::-1]: if 0 <= rr <= 9: out.append(str(rr)) else: out.append(chr(rr +ord('a')-10)) return ''.join(out) # 简单测试一下 print(transform36(int(36 * 35))) # z0
def transform36(n): res = [] while n: res.append(n%36) n = n//36 out = [] for rr in res[::-1]: if 0 <= rr <= 9: out.append(str(rr)) else: out.append(chr(rr +ord('a')-10)) return ''.join(out) # 简单测试一下 print(transform36(int(36 * 35))) # z0