将字符串s = "I want to study Python perfectly"转换为元组,并按照5个一行的格式输出
4条回答 默认 最新
- 於黾 2021-10-29 16:41关注
s = "I want to study Python perfectly" a=tuple(s) n=1 for i in a: print(i,end='') if n%5==0: print() n+=1
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
将字符串s = "I want to study Python perfectly"转换为元组,并按照5个一行的格式输出
s = "I want to study Python perfectly"
a=tuple(s)
n=1
for i in a:
print(i,end='')
if n%5==0:
print()
n+=1