Advertisement
here2share

# int2base_demo.py

Apr 30th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. # int2base_demo.py
  2.  
  3. list = "ABCDEFGHIJKLMNO"
  4.  
  5. def int2base(d, base):
  6.     s = ''
  7.     baseLen = len(base)
  8.     d += 1
  9.     while d:
  10.         s = base[d % baseLen - 1] + s
  11.         d = (d - 1) / baseLen
  12.     return s
  13.  
  14. for z in range(256):
  15.  
  16.         print int2base(z ,list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement