#help with hangman project

32 messages · Page 1 of 1 (latest)

safe jettyBOT
#

@gusty quest

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.

vocal geyser
#

!title help with hangman project

safe jettyBOT
#

help with hangman project

vocal geyser
#

Please read the DM that the bot sent you.

gusty quest
#

@vocal geyser yeo

empty falcon
#

what's the problem? what exactly happens? and what would you expect to happen?

gusty quest
#

for my code its a hangman game. And the main issue is that once you guess the correct letters the code wont print the team

#

i expect that once you guess all the correct letters it should print th team you guessed

empty falcon
#

ok, what does it print?

#

ah, I found the problem

gusty quest
empty falcon
#

the thing is, you never update fullword. So, at the end, when you're checking if fullword == selectedteam, you're actually doing something like "_______" == "arsenal", which obviously isn't true. you need to figure out how to update fullword to have the guessed letters filled :)

gusty quest
#

so how would i do that?

empty falcon
#

there's a couple ways. One, you could check where in the selectedteam string you have the guessed letter, and replace those indices in fullword with the letter.

Another way, which I'd use, is a set. Do you know what that is / how to use it?

gusty quest
#

No 😭

empty falcon
#

ok then, maybe leave it for a latter learning, and try the first way I told you

gusty quest
#

ok

empty falcon
#

since your project is for tomorrow

gusty quest
#

if possible could you give me a more simple way to fix it I don't really understand. @empty falcon

empty falcon
#

sorry I had to leave for a while

empty falcon
gusty quest
#

sorry for asking so much btw im kinda lost on how to fix this 😭

#

sorry to ping but I really need to fix this issue quickly could you help? @vocal geyser

empty falcon
empty falcon
gusty quest