i have a input file having words "Olympics,Olympics,Olympics" when i try to count them and use function readlines() it count them as 1 rather than 3 !! what should i do !! this is my code
def input_files(file):
sum=0
#word=raw_input('enter the word you want to search\n')
file=file.readlines()
for lines in file:
if word in lines:
sum=sum+1
print sum
word=raw_input('enter the word you want to search\n')
file =open("2.txt")
file2=open("3.txt")
input_files(file)
input_files(file2)