题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
str_A = input() data = [] for i in str_A: data.append(i) if len(data)//8 > 0: for j in range((int(len(data)//8)+1)): if len(data) % 8 > 0 and j == len(data)//8: str_AA = ''.join(data[0 + j * 8:(len(data) % 8) + j * 8]) str_B = str_AA.ljust(8, '0') print(str_B) else: str_B = ''.join(data[0 + j * 8:8 + j * 8]) print(str_B) else: str_B = str_A.ljust(8, '0') print(str_B)