Apr-17-2019, 02:48 PM
I trying to write a program, which will correct errors in text file, for example TOm--> Tom, EUrope-->Europe, but if word has two letters, for example IT, program will ask the user if he wants to change second letter.I must use re.sub.
I don't have idea. I have:
I don't have idea. I have:
import re def correct(to_file): with open(to_file,'r') as f: for line in f: for word in line.spilit():But, How to take into account the conditions of the task in re.sub..