0

Can anyone give a code to find single frequency of multiple words from a given paragraph using python.

Think we have a paragraph of 1000 lines. And i have find the single frequency of words 'best' 'and' 'is' 'after' in the paragraph.

26th Jul 2019, 1:13 PM
Lovish Arora
Lovish Arora - avatar
1 ответ
0
string = str(input()) pattern = 'best' count = a = 0 while pattern in string[a:]: a = string[a:].find(pattern)+1 count += 1 print(count)
26th Jul 2019, 1:34 PM
Ivan Avdonin