题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7?tpId=37&tqId=21226&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=
while True: try: str1 = input().strip() arr = [] for i in range(0, len(str1), 8): arr.append(str1[i:(i + 8)].ljust(8, '0')) for i in arr: print(i) except: break
Python刷华为机考题 文章被收录于专栏
无聊刷刷!