How do I do to extract an specific word from a string paragraph? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I do to extract an specific word from a string paragraph?

Extraction

22nd Jun 2020, 2:08 AM
edreack
edreack - avatar
3 Answers
+ 4
In Python (seen through your profile) First, you split the paragraph into a `list`, using space ' ' as delimiter. Then use subscript operator [] to specify a desired element index. para = 'this is ubelievable, you gotta be kidding me' word = para.split(' ')[3] # 'you' print(word)
22nd Jun 2020, 8:58 AM
Ipang
+ 1
In what programming language?
22nd Jun 2020, 3:14 AM
Emanuel Maliaño
Emanuel Maliaño - avatar
22nd Jun 2020, 9:50 AM
edreack
edreack - avatar