You are given a multi line text file and are asked to input a word that you want to find and the output should tell the user what line the word is located and at what character the word is at ie. (abcd c is the second character starting from zero).
f='Abbott: You throw the ball to first base.\nCostello: Then who gets it?\nAbbott: Naturally.\nCostello: Naturally.'
pat=raw_input('Enter a Pattern')
lines=f.split("\n")
for i,line in enumerate(lines):
if pat in line:
print('{} found on line number {} at character {}'.format(pat, i+1,f.find(pat)))
I can't figure out how to do the print statement multiple times if the word is repeated also I cant seem to get the correct character