r/pythonhelp • u/[deleted] • Oct 15 '22
Getting count of string
Get Counts of (A, An, The) in a paragraph. The article should be given as input while running the script.
0
Upvotes
1
u/AmongstYou666 Oct 16 '22
a = "the rain in spain".split(' ')
count_these = "a an the".split(' ')
for i in count_these:
print(i, a.count(i)1
1
u/CraigAT Oct 15 '22
Sounds like homework. What have you got so far?