How do I do to extract an specific word from a string paragraph? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответов
+ 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