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'
#6
Wow I didn't know that was all done already. Great! I'm trying to get better though. At this instance, after some research, I've managed to change my isValid() function to:
def isValid(word):
    file = open("wordsEn.txt", "r")
    for element in file.readlines():
        if element==word:
            return True
        else:
            return False
Though, if I test it with, for example, "extinguisher", it results me 'False'. This is strange, as the word 'extinguisher' is certainly in the list (I've looked it up). I don't really see what I'm doing wrong here :/
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 2,340 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Word generator jack1234 10 209,613 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