How do you loop over a sentence and extract words? Python | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How do you loop over a sentence and extract words? Python

Tried going character by character until space but still don't know how to get the words

1st May 2022, 12:25 PM
Fontebo Achah
Fontebo Achah - avatar
2 Réponses
+ 6
How about you just use split() to automatically create a list of all words in the string.
1st May 2022, 12:27 PM
Slick
Slick - avatar
+ 1
Thanks very much Slick
1st May 2022, 12:30 PM
Fontebo Achah
Fontebo Achah - avatar