-
Notifications
You must be signed in to change notification settings - Fork 56
HW2_Trofimov #10
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?
HW2_Trofimov #10
Conversation
Add function 'multiplication' to 'calculator.py' file
Add 'subtraction' function
Add addition function
Add division function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошая работа! Все что нужно сделали.
Оставил в коде некоторые замечания по оформлению. Они не критические, просто обратите на них внимание на будущее. Спасибо за хорошие сообщения коммитов!
Рад что вы в итоге разобрались с пулл-реквестами в репозитории Мичила :)
Баллы:
К сожалению, не хватает все таки хотя бы небольшого описания в README того функционала, который сделала ваша команда: -0.4 балла.
- За каждую функцию: 1.6 * 5 = 8
- За README 0.6 + 1 доп. = 1.6
- За наличие всех форков и пулл-реквестов - 1 балл
Итого: 10.6
Мерджить не надо, но стоит скинуть показать комментарии всем участникам команды
Молодцы!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это тут что за зверь прокрался? 😁
Это какой то файл настроек папок ОС. Иногда встречаю его даже в тулах выложенных на GitHub. В общем следите за тем что добавляете в git, из-за таких как он поэтому и не стоит делать git add прям всей папки без разбора. Лучше поименно.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это про файл .DS_Store
calc_input = input() | ||
calc_input_lst = calc_input.split() | ||
|
||
operation = calc_input_lst[1] | ||
number_1 = calc_input_lst[0] | ||
number_1 = float(number_1) | ||
number_2 = calc_input_lst[2] | ||
number_2 = float(number_2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В целом код рабочий, хоть и не очень питонячий. Особенно переменные типа calc_input и выглядят calc_input_lst громоздко (хотя нейминг по факту ок!). Это ничего страшного, мы с вами еще научимся опитонячивать наш код. Например, тут это можно было бы сделать так:
calc_input = input() | |
calc_input_lst = calc_input.split() | |
operation = calc_input_lst[1] | |
number_1 = calc_input_lst[0] | |
number_1 = float(number_1) | |
number_2 = calc_input_lst[2] | |
number_2 = float(number_2) | |
num1, operator, num2 = input().split() | |
num1, num2 = float(num1), float(num2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
трюк со сплитом инпута в три переменные хорош...
calc_input_lst = calc_input.split() | ||
|
||
operation = calc_input_lst[1] | ||
number_1 = calc_input_lst[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
number_1 и number_2 хорошие названия, молодцы! Главное что не a и b или не x и y. Я бы сократил, например, до num1 и num2. Но ваш вариант тоже ок.
return print(res) | ||
|
||
|
||
def multiplication(number_1, number_2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше было бы назвать функции глаголами: multuply, add, subtract, divide.
res = number_1 * number_2 | ||
return res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно было бы это немного сократить:
res = number_1 * number_2 | |
return res | |
return number_1 * number_2 |
Но это опять же про питонячесть, что понятие не шибко уловимое.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не знаю автоформатировали ли вы код, но отдельное спасибо за все пробелы и пустые строки где это нужно!
return res | ||
|
||
|
||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Такие вещи еще зачастую пишут через:
if __name__ == '__main__':
main()
На следующей лекции как раз разберем зачем это нужно
res = multiplication(number_1, number_2) | ||
elif operation == "/": | ||
res = division(number_1, number_2) | ||
return print(res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А вот это после лекции 3 мы знаем что вернет нам None. Потому что print выдает None и мы его перехватим в return. Это я кажется в ТЗ не очень хорошо прописал по поводу результата, но всё-таки либо print(res)
, либо return res
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
цэ убийственный кринж... каюсь..
@@ -0,0 +1,12 @@ | |||
# Calculator | |||
Yep. Calculator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
- Ilia Popov ('multiplication' function) | ||
- Julia Nechaeva ('addition' function) | ||
- Ekaterina Shitik ('subtraction' function) | ||
- Ricardo Milos / Pavel Grobushkin ('division' function) | ||
- Michil Trofimov ('main' function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Круто что вы перечислили обязанности каждого члена команды 👍
Еще бы подписать тут кто тимлид.
И не хватает самого хотя бы небольшого описания вашей мини-программы magnificent piece of software engineering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ды, оплошал, описание нашего инжира надо было доабвить
No description provided.