#๐ Does anyone know why this error message is not printing?
12 messages ยท Page 1 of 1 (latest)
@fallow sentinel
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.
you have two cases in the match statement and you entered something completely different, so why would it go into either of the branches?
Can you explain it in easier terms please
I started like 4 days ago
match is like if / elif, so you check the input against two possible options, but you enter neither of those
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
either input "add to list" or "show list"
(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.")
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.