#๐Ÿ”’ Hangman game

8 messages ยท Page 1 of 1 (latest)

quick crown
#

my issue: I can't seem to understand why when I typed in the letter "u" it said that the letter wasn't included in the random word but the random word was "midas touch" meaning it had the letter "u" in it and it still identified it as the wrong letter.

attempts was supposed to be 10 but idk why it said I only have one attempt

Please help

sturdy hareBOT
#

@quick crown

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

novel atlas
#

I'm not sure if this is your issue, but I noticed a few problems. Looks like you're missing some commas in word =, so some of those words will be combined into longer words. You made word_display into a generating function using (), so you can only iterate over it once, I'd change that to []. And when you do input == chosen_word you're comparing the input function to a string, so that will always be false (unless you're using input as a variable somehwhere else, which you probably shouldn't)

#

I think your core issue though is that the else is inside the for loop as part of the if letter == guess if statement when I think you mean to have it be part of the if guess in chosen_word if statement

#

Change the generating comprehension into a list comprehension by using [] is what I meant to say

sturdy hareBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.