- 1

How to make a loop in alphabet like this

name=aizen mot Output: a ai aiz aize aizen aizen m aizen mo aizen mot https://code.sololearn.com/cRlxT5X7FA9I/?ref=app

27th Aug 2019, 10:01 AM
Aizen Mot
Aizen Mot - avatar
5 odpowiedzi
+ 1
It is very easy with slicing: for i in range(1, len(name)+1): print(name[:i])
27th Aug 2019, 11:34 AM
Seb TheS
Seb TheS - avatar
0
Show us your attempt?
27th Aug 2019, 10:12 AM
Trigger
Trigger - avatar
0
It's not done yet bcuz i dont know what to do
27th Aug 2019, 10:21 AM
Aizen Mot
Aizen Mot - avatar
0
print() is a function Example of your question at bottom https://code.sololearn.com/c3KBj6fpFg5c/?ref=app
27th Aug 2019, 10:28 AM
Trigger
Trigger - avatar
0
Nice! Thank you guys!
27th Aug 2019, 10:38 AM
Aizen Mot
Aizen Mot - avatar