i have this code but this only prints the line number in the incorrect word *text1*. however i want it to print the line number of the incorrect word located in the text file called words. what can i add to it or arrange?
# text1 is my incorrectwords
# words is my txt file
from collections import defaultdict d = defaultdict(list) for lineno, word in enumerate(text1): d[word].append(lineno) print(d)