PHP前端开发

python怎么垂直输出

百变鹏仔 1个月前 (01-23) #Python
文章标签 python

垂直输出"hello world",全部代码不超过2行。

例:输出为以下情况(推荐学习:Python视频教程)

Hello World

可以使用for循环完成:

for name in "Hello World":    print(name)

也可以使用join方法完成:

立即学习“Python免费学习笔记(深入)”;

print("".join("Hello World"))

更多Python相关技术文章,请访问python-tutorials.html" target="_self">Python教程栏目进行学习!