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

Split generator

Given a string as input, create a generator function that splits the string into separate words and outputs the resulting list.

13th Jul 2022, 6:05 PM
Zocimo Orozco Valencia
4 Answers
+ 4
Mihir Lalwani , Zocimo Orozco Valencia , the request is to use a generator function to solve this task...
13th Jul 2022, 7:16 PM
Lothar
Lothar - avatar
+ 1
Txt = input() def word(str): return str.split() print(word(Txt))
13th Jul 2022, 6:14 PM
Mihir Lalwani
Mihir Lalwani - avatar
0
txt = input() def words(): #your code goes here return txt.split() print(list(words()))
13th Jul 2022, 6:06 PM
Zocimo Orozco Valencia
- 1
xgjtdshjtryjfhszdkdxfg
8th Sep 2022, 12:28 PM
21CSE8221 MANI SANKAR .K