while True: try: n = input('') if len(n)%8 == 0: n_len = len(n)//8 for i in range(n_len): a = 8*i b = 8+8*i print(n[a:b]) elif len(n) < 8: c = '0'*(8-len(n)) print(n+c) ...