+ 1
Is there any better way than using "\n" after each letter to print something vertically?
As in the question. Is there any faster way to print something vertically? https://code.sololearn.com/cHFXSO80o3yo/?ref=app
4 Answers
+ 1
for i in "Hello World!":
print(i)
+ 1
It is a for loop. It is iterating thru each letter in the string "Hello World!" .. as it picks the next letter it assigns it to the variable i and prints that variable. then it moves onto the next char in the string and assigns it to the variable i. prints it to the screen. continues until the loop runs out of letters to assign to the variable i
+ 1
Thanks. I should figure it out on my own I guess...
0
Thanks a lot! I'd like to know how it is doing it, but I guess I'll get to it sooner or later.