Python Forum
No output in 'english word generator'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No output in 'english word generator'
#8
This seems to work too, is it correct?
def isValid(word):
    file = open("AllEnglishWords.txt", "r")
    if word in file.read():
        return True
    else:
        return False

print(isValid("\n"+word+"\n"))
I adjusted the file with two 'enters' at the beginning and the end of the file.
Reply


Messages In This Thread
RE: No output in 'english word generator' - by DeGerlash - Jan-06-2018, 05:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,493 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Word generator jack1234 10 166,299 Jul-03-2017, 09:30 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020