misc/python/base.py

4 lines
118 B
Python
Raw Permalink Normal View History

2018-08-05 18:53:07 +02:00
## Base conversion codegolf
r,b=range,lambda n,k:n==0and'0'or b(n//k,k).lstrip('0')+map(chr,r(48,58)+r(65,91))[n%k]