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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!