题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
# format()格式化输出功能确实牛
while True:
try:
l = input()
for i in range(0, len(l), 8):
print("{0:0<8s}".format(l[i:i+8]))
except:
break

查看2道真题和解析