Skip to content

Conversation

@rereremin
Copy link

No description provided.

@@ -0,0 +1,34 @@
def multiply(a, b):

Choose a reason for hiding this comment

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

Возможно, стоит использовать более информативный нейминг переменных, например num_1, num_2. На оценку это не повлияет, разумеется, но в будущем стоит обратить внимание :)

return a - b

def main():
expression = input("Введите математическое выражение: ")

Choose a reason for hiding this comment

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

Юзабилити +++

else:
print("Неверный оператор")
return
print(f"Результат: {result:.2f}")

Choose a reason for hiding this comment

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

Лучше это сделать через return, иначе получается, что функция ничего не возвращает. print()-ом как раз мы хотим выводить на экран результат работы функции. Без return результат работы калькулятора невозможно будет использовать в дальнейшем коде.

Comment on lines +28 to +29
print("Неверный оператор")
return

Choose a reason for hiding this comment

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

Здорово, что предусмотрено взаимодействие с пользователем в случае неверного оператора.
Не очень здорово, что return пустой, и функция будет возвращать None

else:
print("Неверный оператор")
return
print(f"Результат: {result:.2f}")

Choose a reason for hiding this comment

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

Suggested change
print(f"Результат: {result:.2f}")
return result

print("Неверный оператор")
return
print(f"Результат: {result:.2f}")
main()

Choose a reason for hiding this comment

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

Suggested change
main()
if __name__ == "__main__":
main()

Лучше использовать такую конструкцию (но это вас ещё ждёт впереди)


def main():
expression = input("Введите математическое выражение: ")
number1, operator, number2 = expression.split()
Copy link

@pavlovanadia pavlovanadia Sep 18, 2023

Choose a reason for hiding this comment

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

Хорошая распаковка и нейминг переменных!

number1, operator, number2 = expression.split()
number1 = float(number1)
number2 = float(number2)
result = None

Choose a reason for hiding this comment

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

Хорошо задана переменная result

3. Мухаметшина Регина - divide()
4. Жерко Никита - add()
5. Ерофеева Наталья - subtract()

Choose a reason for hiding this comment

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

Хотелось бы тут видеть примеры использования программы, что она получает на вход, что она выдаёт на выходе. Условному пользователю лучше сразу понимать, как с ней взаимодействовать.
В частности, в README указаны названия всех реализованных функций, но не написано, что их названия являются единственно рабочими операторами (а это не очевидно!)

Но хорошо, что указан состав команды, кто какую функцию реализовал. Фото 🔥

Choose a reason for hiding this comment

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

Хорошая работа!
Если учесть небольшие исправления по мелочам, то вообще всё будет супер.

Оценка:
Функции: 1.6 * 5 = 8
Ветки и пулл-реквесты: 1 балл
README: 0.6
Доп. балл за фото: 1

Итог: 10.6

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.

4 participants