+ 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

20th Jun 2017, 9:44 PM
arveth
4 Réponses
+ 1
for i in "Hello World!": print(i)
20th Jun 2017, 10:14 PM
Adrian
Adrian - avatar
+ 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
20th Jun 2017, 11:59 PM
LordHill
LordHill - avatar
+ 1
Thanks. I should figure it out on my own I guess...
21st Jun 2017, 12:26 AM
arveth
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.
20th Jun 2017, 10:20 PM
arveth