Python Forum
hangman doesn't end after guessing the word
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hangman doesn't end after guessing the word
#4
You're right, the game does not end if there is a double letter in the word. And you can't guess the same letter twice. It shouldn't be testing against len(list(secret_word)), but rather against len(set(secret_word)). Using set(secret_word) will give you all the unique letters in the string.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: hangman doesn't end after guessing the word - by ichabod801 - Nov-06-2019, 09:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hangman Troubleshooting Ewilliam51 5 3,131 Jul-22-2020, 07:09 AM
Last Post: Sooqa
  fun with hangman! Low_Ki_ 7 7,040 Jun-13-2017, 05:03 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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