Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bi = input()
- while bi[0]==0:
- bi.pop(0)
- bi = '0'*(3-len(bi) % 3) + bi
- oct_dig = ['000','001','010','011','100','101','110','111']
- res = ''
- while bi:
- res += str(oct_dig.index(bi[-3:]))
- bi = bi[:-3]
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment