I want to use re.findall
for detecting how many times is a a word displayed in a .txt file. Also I need that if I'm trying to count how many times the word Hello appears in the text Hellooo to be detected.
Here is all the code I have:
# -*- coding: utf-8 -*-
import re
total = 0
with open('text.txt') as f:
for line in f:
total = re.findall('Hello')
print total