Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # t_zbase_n.py -- thanks for the help on this, you people are awesome
- def zbase(n, b=3,length=4):
- b += 1
- if n == 0:
- return [0]*length
- values = []
- for z in 'Z'*length:
- r = n % b
- n = int(n/b)
- values.append(r)
- return values[::-1]
- 0
- i = 0
- while 1:
- t = zbase(i,4,3)
- if not t:
- break
- print i, '\t', t
- i += 1
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement