电脑网络

怎么python编写程序运行后输入123输出1,2,3

346 浏览

怎么python编写程序运行后输入123输出1,2,3

1 个回答

AwPGUZLVx用户头像
AwPGUZLVx 回答于 2024-07-20
已采纳

提问:怎么python编写程序运行后输入123输出1,2,3

网友回答:

参考:

a=input()
f=True
for c in a:
   if f:
       print(c,end='')
       f=False
   else:
       print(",",c,end='')
       
其中的f为控制逗号

结果


我来回答

相关问题