PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Method one
a = input().lower() or 'and'
Qoute = "Always do your best. Your best is going to change from moment to moment; it will be different when you are healthy as opposed to sick. Under any circumstance, simply do your best, and you will avoid self-judgment, self-abuse and regret."
count=0
for word in Qoute.split():
#print(word)
if a == word.lower():
count+=1
print(count)
#Method two
print((Qoute.lower()).count(a))
#Method three
import re
l= re.findall(a,Qoute.lower())
print(len(l))
#Method four
from collections import Counter
count= Counter((Qoute.lower()).split())
print(count.get(a))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run