I want to find if some spam words like "gift", "sign" and "buy" are in my text, and I know gift and sign appear twice and one time respectively, but when I run the below code the count is 0 for all words. Any help?
efile= open('email.txt', 'r')
eMail = efile.read()
gift_count = 0
sign_count = 0
buy_count = 0
for word in eMail:
if word == 'sign':
sign_count+=1
if word == 'gift':
gift_count+=1
if word == 'Buy':
buy_count += 1
efile.close()
print (" In the email file: the words sign appears " \
, sign_count," the word gift appears " \
, gift_count, " the word Buy appears " \
, buy_count)