Skip to content

Test code#13

Open
AgarwalSugandha wants to merge 2 commits intoTMAP-Community:masterfrom
AgarwalSugandha:testCode
Open

Test code#13
AgarwalSugandha wants to merge 2 commits intoTMAP-Community:masterfrom
AgarwalSugandha:testCode

Conversation

@AgarwalSugandha
Copy link

if __name__ == "__main__":
calculator_view.initialize_calculator()
class CalculationService:
"""""Class for keeping track of, and evaluating calculations"""""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less quotes maybe?

@@ -1,6 +1,75 @@
"""This module starts the application."""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we going to start the calculator now?




def clear(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the code from line 56 onwards not commented intentionally?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comment on function of code

except:
self.equation.set(" error ")
self.expression = ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary amount of newlines

import multiply_service as multiply_service


if __name__ == "__main__":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the program now does nothing on execution


def set_equation(self, new_equation):
"""set equation"""
self.equation.set(new_equation)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no blank line at the end of the file

def multiply(string):
arguments = string.split("*")
result = int(arguments[0]) * int(arguments[1])
return result

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no blank line at the end of the file

import calculator_view as calculator_view
"""Module for the CalculationService class"""
from tkinter import StringVar
import divide_service as divide_service

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

divide_service does not exist in this repository


# evaluate the expression/calculation
if "/" in self.expression:
total = str(divide_service.divide(self.expression))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

divide_service does not exist in this repository

total = str(eval(self.expression))


if float(total) > 10:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not according to Py style guide: "distinguish arguments from the rest"

Copy link
Collaborator

@RikMarselis RikMarselis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix my comment and ask for another review

@@ -0,0 +1,4 @@
def multiply(string):
arguments = string.split("*")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants