#๐Ÿ”’ code has no errors but does not print something

27 messages ยท Page 1 of 1 (latest)

vapid duneBOT
#

@south rivet

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.

proven mesa
#

Are you expecting it to print?

#

Can you share your code? @south rivet

south rivet
#

im sorry having trouble sharing it. i shared everything but it tells me to use a pastebin and its my first time using this

calm berry
#

copy and paste

south rivet
#

i did that but it just deletes the code

proven mesa
#

By that they mean't don't copy/paste

#

you should use the pastebin

#

!paste

vapid duneBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

south rivet
proven mesa
#

Alright. And what are you expecting it to do?

south rivet
#

ok so the problem with this is, the code runs fine, the hangman games works perfectly. the issue is theres a function at the end called hangman_with_hints and through that function the code is supposed to print possible other words that match the word we are currently guessing. we are supposed to see the matches when we type an asterisk. but when i do that nothing happens and i cant seem to find the issue

#

theres a part of the code at the end that says when you uncomment these two lines and comment the following lines you play a hangman game where you get to use hints. i do that and it still doesn't work

proven mesa
#

Did you write this code?

south rivet
#

no i wrote the difficult functions using AI

proven mesa
#

Ah, so you cheated

south rivet
#

its been a few months since i started writing i really can't type code properly myself ๐Ÿฅฒ

proven mesa
#

Well, that's cause you're using AI

#

How are you going to learn that way?

#

Anyways, what have you done so far to debug/narrow down the issue?

south rivet
#

i thought the issue was with match_with_gaps

#

that it hasnt been called in any function?

proven mesa
#

Looks like show_possible_matches calls it

south rivet
#

oh so it's been called through that function. another thing i thought might've been the issue was in the hangman function i use .isalpha() to check if the user is typing any other character, so obviously if i type and asterisk is would've caused the user to lose a warning. so i added a statement that didnt remove a warning when an asterisk is type but it just doen't type anything when i do that

vapid duneBOT
#
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.