Home >Backend Development >Python Tutorial >How to output vertically in python
#How does python output vertically? Here are two methods to introduce to you:
The first one
str = "python" for name in str[:]: print(name)
Related recommendations: "Python Video Tutorial》
Running result:
p y t h o n
Second type
print("\n".join("python"))
Running result:
p y t h o n
The above is the detailed content of How to output vertically in python. For more information, please follow other related articles on the PHP Chinese website!