forked the main site so I can upload code for HW#127
Closed
iampei wants to merge 1 commit intoUWPCE-PythonCert:masterfrom
Closed
forked the main site so I can upload code for HW#127iampei wants to merge 1 commit intoUWPCE-PythonCert:masterfrom
iampei wants to merge 1 commit intoUWPCE-PythonCert:masterfrom
Conversation
There was a problem hiding this comment.
Because you are raising a ValueError, and not including a message no error will show up on your page. You should either include a message:
raise ValueError("Please use 'add', 'subtract', 'multiply', or 'divide'")
or catch the ValueError in your application function, and address it there. Also, it shouldn't be a ValueError, but probably a NameError, since these are not numbers.
|
Works, yay! A couple of notes, Cris had asked to include a readme, which is a good habit to get into. Also, it is best to have tests. In a small app like this, it may seem like overkill, but when you start trying to refactor larger code bases, you will be glad to be in the habit of writing tests. Finally, I would think about how you might refactor your app to allow more inputs (2+3+5, for example). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I uploaded all 3 sessions - simple calculator: added divide by 0 error.