Open
Conversation
AgarwalSugandha
commented
Feb 27, 2025
Stim-SUP
reviewed
Mar 6, 2025
| if __name__ == "__main__": | ||
| calculator_view.initialize_calculator() | ||
| class CalculationService: | ||
| """""Class for keeping track of, and evaluating calculations""""" |
Stim-SUP
reviewed
Mar 6, 2025
| @@ -1,6 +1,75 @@ | |||
| """This module starts the application.""" | |||
There was a problem hiding this comment.
How are we going to start the calculator now?
|
|
||
|
|
||
|
|
||
| def clear(self): |
There was a problem hiding this comment.
Is the code from line 56 onwards not commented intentionally?
Stim-SUP
reviewed
Mar 6, 2025
ThimoCode
reviewed
Mar 6, 2025
| except: | ||
| self.equation.set(" error ") | ||
| self.expression = "" | ||
|
|
ThimoCode
reviewed
Mar 6, 2025
| import multiply_service as multiply_service | ||
|
|
||
|
|
||
| if __name__ == "__main__": |
There was a problem hiding this comment.
the program now does nothing on execution
ThimoCode
reviewed
Mar 6, 2025
|
|
||
| def set_equation(self, new_equation): | ||
| """set equation""" | ||
| self.equation.set(new_equation) |
ThimoCode
reviewed
Mar 6, 2025
| def multiply(string): | ||
| arguments = string.split("*") | ||
| result = int(arguments[0]) * int(arguments[1]) | ||
| return result |
ThimoCode
reviewed
Mar 6, 2025
| import calculator_view as calculator_view | ||
| """Module for the CalculationService class""" | ||
| from tkinter import StringVar | ||
| import divide_service as divide_service |
There was a problem hiding this comment.
divide_service does not exist in this repository
ThimoCode
reviewed
Mar 6, 2025
|
|
||
| # evaluate the expression/calculation | ||
| if "/" in self.expression: | ||
| total = str(divide_service.divide(self.expression)) |
There was a problem hiding this comment.
divide_service does not exist in this repository
| total = str(eval(self.expression)) | ||
|
|
||
|
|
||
| if float(total) > 10: |
There was a problem hiding this comment.
Not according to Py style guide: "distinguish arguments from the rest"
RikMarselis
suggested changes
Aug 14, 2025
Collaborator
RikMarselis
left a comment
There was a problem hiding this comment.
Fix my comment and ask for another review
| @@ -0,0 +1,4 @@ | |||
| def multiply(string): | |||
| arguments = string.split("*") | |||
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.