0

Display Each Character of String Vertically

String = "Your Name" How do you do this? Output: Y o u r N a m e

13th Jul 2017, 7:50 AM
Joseph Adrian Padriga
Joseph Adrian Padriga - avatar
4 ответов
+ 7
for i in string: print(i)
13th Jul 2017, 8:00 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 4
Replace "." in either line with "\n": https://code.sololearn.com/c876jbnGfG61/?ref=app
13th Jul 2017, 4:35 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
String = "Your Name" for s in String: print(s)
13th Jul 2017, 8:22 AM
Cornel
Cornel - avatar
+ 1
Here's another way: string = 'Your Name' print('\n'.join(string))
13th Jul 2017, 8:45 AM
Igor B
Igor B - avatar