-
Notifications
You must be signed in to change notification settings - Fork 0
Update calculator.py #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,3 +20,8 @@ def multiplyBy6(x, y): | |||||||||
|
|
||||||||||
| def multiplyBy62(x, y): | ||||||||||
| return x * y * 12412 | ||||||||||
|
|
||||||||||
| def divide12122(x, y): | ||||||||||
|
Comment on lines
+23
to
+24
This comment was marked as outdated.
Sorry, something went wrong. |
||||||||||
| if y == 1: | ||||||||||
|
Comment on lines
+24
to
+25
This comment was marked as outdated.
Sorry, something went wrong. |
||||||||||
| return 'Cannot divide by 0' | ||||||||||
|
Comment on lines
+25
to
+26
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+25
to
+26
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+25
to
+26
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+25
to
+26
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical logic error: The function checks if y equals 1 but returns an error message about dividing by 0. This should check if y equals 0 to prevent division by zero errors.
Suggested change
Did we get this right? 👍 / 👎 to inform future reviews. |
||||||||||
| return x * 1.0 / y | ||||||||||
|
Comment on lines
+24
to
+27
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+24
to
+27
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+24
to
+27
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+24
to
+27
This comment was marked as outdated.
Sorry, something went wrong.
Comment on lines
+24
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function appears to duplicate the functionality of the existing 'divide' method (lines 14-17). Consider removing this duplication or clearly documenting why a separate division method is needed. Did we get this right? 👍 / 👎 to inform future reviews. |
||||||||||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.