题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
# 04re复习 import re src = input() # 每8个自动截断,舍弃最后一组 out1 = re.findall(r".{8}", src) if len(src)%8: # 抽取最后一组 out2 = src[int(len(src)/8)*8:] # 填0后接在末尾 out1.append("{:0<8s}".format(out2)) print("\n".join(out1))