0
How will i create a python program that displays a text hotizontally and vertically on the background
4 Respuestas
+ 4
print("hello \n h \n e \n l \n l \n o")
+ 1
Like a sample? How?
+ 1
Um... text is always outputted horizontally.
For vertical you can write a function that takes input, outputs them one by one with a line break
def vertical_print(text):
for c in text:
print(c)
or a one-liner since its my fetish
print("\n".join([c for c in text]))
+ 1
You can use join method as well to represent a horizontal text vertically instead of writing many \n
print("\n".join("hello"))
But it depends on what you want to do actually