cainiaofei
2022-09-30 阅读量: 1044
可以通过for循环遍历字符串中的每个元素进行输出,输出的时候使用print(),其默认换行输出,因为参数end默认设置为换行符‘\n’,结果如下:
for i in 'helloworld':
print(i)