-
Notifications
You must be signed in to change notification settings - Fork 55
hw_zolotikov #7
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?
hw_zolotikov #7
Changes from all commits
ea5a68d
ef86af1
59e0c6c
7f6356e
ba29cf4
a2e8192
fb46168
5351afc
1f2c423
ab3290d
e3d26a4
335fdd9
0af610d
225530d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| **Состав команды**: | ||
| - Золотиков Устин - тимлид, README.md | ||
| - Волкова Юлия - mysum() | ||
| - Огурцова Анна - main(),mydiv() | ||
| - Федоренко Алиса - mysub() | ||
| - Козин Иван | ||
|  | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||
| def mymult(x, y): | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Если так называть наверное чуть лучше было бы
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Здесь и далее лучше использовать более информативные названия переменных. Названия x и y не отражают содержимого. Лучше было бы, например, num1 и num2. Здесь за это баллы еще не снижаем, но с ДЗ 4 нейминг начнет влиять на оценку. |
||||||||||||||||
| return x * y | ||||||||||||||||
| def mysub(x, y): | ||||||||||||||||
| return x - y | ||||||||||||||||
| def mysum(a, b): | ||||||||||||||||
| return a+b | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Не хватает пробелов
Suggested change
|
||||||||||||||||
| def mydiv(x,y): | ||||||||||||||||
| return x/y | ||||||||||||||||
| def main(): | ||||||||||||||||
|
Comment on lines
+8
to
+9
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Между определениями функций принято оставлять 2 пустые строки (ссылка). Тут это не критично, но с ДЗ 4 может влиять на оценку.
Suggested change
|
||||||||||||||||
| inp = input('vvedite to, chto nado poschitat') | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||
| inp = inp.split(sep =' ') | ||||||||||||||||
| x = float(inp[0]) | ||||||||||||||||
| y = float(inp[2]) | ||||||||||||||||
| sign = inp[1] | ||||||||||||||||
|
Comment on lines
+10
to
+14
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. В целом код рабочий, хоть и не очень питонячий. Это ничего страшного, мы с вами еще научимся. Например, тут это можно было бы сделать так:
Suggested change
Название sign в целом не плохое, но я не уверен что в английском "знак" в смысле математического знака так и переводится. Поэтому я бы сделал operator, хоть так и подлиннее. |
||||||||||||||||
| result = 0 | ||||||||||||||||
| if sign == "+": | ||||||||||||||||
| result = mysum(x,y) | ||||||||||||||||
| elif sign == "-": | ||||||||||||||||
| result = mysub(x,y) | ||||||||||||||||
| elif sign == "*": | ||||||||||||||||
| result = mymult(x,y) | ||||||||||||||||
| elif sign == "/": | ||||||||||||||||
| result = mydiv(x,y) | ||||||||||||||||
| else: | ||||||||||||||||
| result = "Oshibka" | ||||||||||||||||
|
Comment on lines
+24
to
+25
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Хорошо что сделали else который обрабатывает любой другой неподдерживаемый оператор. Обработать такую ситуацию можно было бы на самом деле чуть аккуратнее, но этому мы еще научимся. |
||||||||||||||||
| print(result) | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Все-таки наверное лучше было бы сделать через return, но наверное это моя неточность в ТЗ. |
||||||||||||||||
| main() | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Такие вещи еще зачастую пишут через if __name__ == '__main__':
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.
Круто что вы перечислили обязанности каждого члена команды 👍
В будущем будет здорово если будете тренироваться делать README на английском