Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # int2abc.py * 17575
- import string
- alpha = string.letters
- def int2abc(z):
- z = min(z,26*26*26-1)
- c = z/(26*26)%26
- b = z/26%26
- a = z%26
- return ''.join([alpha[z] for z in [c,b,a]])
- print int2abc(0) # aaa
- print int2abc(25) # aaz
- print int2abc(26) # aba
- print int2abc(26*26*26) # zzz
- print 26*26*26
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement