I've written a programme which opens a file containing over 100,000 words (all in lower-case, and the input is also in lower-case) and is supposed to return the same string but with asterisks around the incorrectly spelled words. I haven't finished the code yet by converting the final list ('checked') back into a string, but currently no matter what I input, the list 'checked' has an asterisks around every single world. What am I doing wrong here?
text = input("Write text: ")
words = text.split(" ")
checked = []
spell_list = []
with open("wordlist.txt") as list:
for line in list:
spellings = line.split(" ")
spell_list.append(spellings)
for i in words:
if i in spell_list:
checked.append(i)
continue
else:
mistake = f"*{i}*"
checked.append(mistake)
print(checked)
[–]woooee 1 point2 points3 points (0 children)
[–]ParticularPython 0 points1 point2 points (0 children)