#๐ personal project - needs some help with variables
28 messages ยท Page 1 of 1 (latest)
@vital mesa
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.
well, the code above was made to use 0 when the grade letter was unrecognized
so why is that unexpected?
i thought that if letter wasnt matched, a error would be raised?
For that you'll need to write
return grade_score[grade.upper()]```
your .get function returns a zero if the value isn't found, ValueError is never raised
ohhh, thank you very much guys !
No problem, just please share code as text next time, not a picture, so we can paste in into an IDE
Issues like this one are quickly caught by a good type checker like mypy, this will save us a lot of time on helping
i tried, but the bot said file was not accepted :((
type three backticks and "py" in discord, copy your code and paste it, type three more backticks, press enter
print("like that")
there were too many lines , so i tried using https://paste.pythondiscord.com/OIWQ
but i couldnt figure out how to send a accepted file
could you help me such that next time i would know how to use it haha, thanks
Well, i just pasted your code into the window, clicked paste and everything works
Maybe there was a bug or something
what do you suppose the 0 argument was there for?
now that i think about it, i overlooked the '0' thinking that that would raise an error , my bad
thank you to the both of you guys for your time
No problem!
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.