#๐Ÿ”’ Does anyone know why this error message is not printing?

12 messages ยท Page 1 of 1 (latest)

fallow sentinel
#

When I run it it just acts like nothing happens.(im very very new)

heady elmBOT
#

@fallow sentinel

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.

austere ruin
#

you have two cases in the match statement and you entered something completely different, so why would it go into either of the branches?

fallow sentinel
#

I started like 4 days ago

austere ruin
#

match is like if / elif, so you check the input against two possible options, but you enter neither of those

safe scarab
#

Your if is inside the second case. It's not a catch-everything-else type of if, you don't have such case in your code

austere ruin
#

either input "add to list" or "show list"

safe scarab
#

(Also, that's not how you make an if to compare content of a variable)

#

The default case (the catch-everything-else) for python's match would be

case _:
    print("Error. Try Again.")
heady elmBOT
#
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.