Question: *In Python I have a program that splits a sentence into words. def sent(text): return ([i for item in text for i in item.split()]) text
*In Python
I have a program that splits a sentence into words.
def sent(text): return ([i for item in text for i in item.split()]) text = ['With an estimated population of 8,336,817 in 2019, New York'] print(sent(text))
I want it to recognize "New York" (or any other cities) as only one word though. How would I do that?
I want it to split that, but for the name "New York" or any
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
