def replace_verb(line):
    for verb, color in list(VERBS.items()):
        if verb in line:
            return '%s %s;' % (line.replace(verb, '->'), color)
return line

def main():
    filename = 'my_file.txt'
with open(filename, 'r') as fp:
    for line in fp:
        print(replace_verb(line))
if __name__ == '__main__':
    main()
Put bar at the end of every line that includes foo