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.
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)