I have a txt file with words in it and I had to print the incorrect words into a set which I have.
Now I need to find in which line the incorrect words are in the text file and print it as a dictionary
for e.g. it should look like together:
togeher 3 4 #word being the incorrect word and 3 and 4 the line number where it is located in the txt file.
I know I need to use a line counter but dont know how to use it
words = [] # is my txt file
text1 # is my set of incorrect words
i have done this so far:
d = {} # an empty dictionary
key = text1
value = linecounter # dont know what to assign the value to
for
Now I need to find in which line the incorrect words are in the text file and print it as a dictionary
for e.g. it should look like together:
togeher 3 4 #word being the incorrect word and 3 and 4 the line number where it is located in the txt file.
I know I need to use a line counter but dont know how to use it
words = [] # is my txt file
text1 # is my set of incorrect words
i have done this so far:
d = {} # an empty dictionary
key = text1
value = linecounter # dont know what to assign the value to
for
Comment