Simple Code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Simple Code

def make_word():    word = ""    for ch  in "spam":        word +=ch        yield word print(list(make_word())) Output: s, sp, spa, spam

23rd May 2017, 1:29 AM
Bahrom Izbosarov
Bahrom Izbosarov - avatar
2 Answers
+ 6
No offense but there's a section in this app for posting codes you know.
23rd May 2017, 1:52 AM
CHMD
CHMD - avatar
0
Cool
23rd May 2017, 1:31 AM
Maaz
Maaz - avatar