Turn it into one argument, such as with the newish format strings:
logfile.write(f'Total Matched lines : {len(matched_lines)}\n')
Or, if you're running a version before where this facility was added (3.6, I think), one of the following:
logfile.write('Total Matched lines : {}\n'.format(len(matched_lines)))
logfile.write('Total Matched lines : ' + str(len(matched_lines)) + '\n')
Aside: I've added a newline since you're writing to a log file (most likely textual) and write does not do so. Feel free to ignore the \n if you've made the decision to not write it on an individual line.