Open
Conversation
add addition()
Add substract() and multiply()
Hw2 borovikova
IvanKozlov98
left a comment
There was a problem hiding this comment.
Привет, хорошая работа!
- Обратите внимание на правила написания сообщений коммитов. Например, они должны начинаться с большой буквы, и не следует их брать в кавычки
- Функция
mainи функции калькулятора имеют разные отступы. При мердже нужно быть аккуратнее :)
-2 балла - Ещё раз обратите внимание на названия переменных. -2 балла
Оценка:
За функции: 76/80 баллов
За README: 10/10 баллов
За коммиты и правильную структуру форков: 10/10
- 10 доп.
Итого: (96+10)/100 баллов
Comment on lines
+2
to
+15
| def addition(n1, n2): | ||
| return n1 + n2 | ||
|
|
||
| #Divison | ||
| def divison(x, y): | ||
| return x / y | ||
|
|
||
| # Функция для вычитания | ||
| def subtract(a, b): | ||
| return a - b | ||
|
|
||
| # Функция для умножения | ||
| def multiply(a, b): | ||
| return a * b |
There was a problem hiding this comment.
- названия переменных в функциях неконсистентны -- где-то
(n1,n2),(x, y),(a, b) - названия переменных как-то должны подчеркивать -- что это числа -
a,b- могут быть в теории чем угодно. Самое близкое к желаемомуnum1, num2
-2 балла
| built = (input()).split() | ||
| number1=float(built[0]) | ||
| number2=float(built[2]) | ||
| if built[1] == '+': |
There was a problem hiding this comment.
built[1] также можно было записать в переменную, например, operator :)
Comment on lines
+20
to
+21
| number1=float(built[0]) | ||
| number2=float(built[2]) |
There was a problem hiding this comment.
принято ставить пробелы при декларации переменных
Suggested change
| number1=float(built[0]) | |
| number2=float(built[2]) | |
| number1 = float(built[0]) | |
| number2 = float(built[2]) |
Contributor
Небольшая поправка - за нейминги пока не снижаем. Но всё равно обратите внимание! |
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.
No description provided.