Question:
Hi! So, I’m making a code to solve the NYT Spelling Bee Game, and I’m struggling to filter out words that have letters other than the provided ones. I’ve briefly annotated the problem section, and everything else should be working fine. Thanks!
Repl link:
https://replit.com/@kylieo141/Spelling-bee
Code Snippit:
for count in range(len(oldtrue)-2):
word.append(oldtrue[0])
test=word[0]
for d in range(len(test)):
temp=test[d]
temp=str(temp)
if temp == other[0]:
bad=False
elif temp == other[1]:
bad=False
elif temp == other[2]:
bad=False
elif temp == other[3]:
bad=False
elif temp == other[4]:
bad=False
elif temp == other[5]:
bad=False
elif temp == other[6]:
bad=False
else:
bad=True
if bad==True:
count+=1
break
else:
bad=True
if count >= 1:
bad=True
else:
final.append(test)
word.pop(0)
oldtrue.pop(0)