i currently have this piece of code
i need to create a dictionary that prints the incorrect word and the line number where it is incorrect.
words [] # is my txt file
text1 [] # is my list of incorrect words
i am new to programming and dont know much syntax so hope you can help and tell me what i have done wrong or need to change cheers.
d = {}
counterline = 0
for lines in words:
text1 = lines.split()
counterline += 1
if text1 not in d:
d[text1] = [counterline]
if text1 in d:
d[text1].append[counterline]
print(text1, d[counterline])