Skip to content

Python practice develop - #1

Open
Ch1komon wants to merge 3 commits into
python_practice_masterfrom
python_practice_develop
Open

Ch1komon wants to merge 3 commits into
python_practice_masterfrom
python_practice_develop

Conversation

@Ch1komon

@Ch1komon Ch1komon commented Jun 6, 2023

Copy link
Copy Markdown
Owner

No description provided.

@Ch1komon
Ch1komon requested a review from vladefr97 June 6, 2023 19:03
Comment thread 1/palindrome.py
@@ -0,0 +1,9 @@
#1. Написать функцию, которая проверяет является ли строка палиндромом.
def palindrome(s):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Желательно ставить типизацию везде

Comment thread 3/figures.py

def compare_area(self, other_shape):
if self.area() > other_shape.area():
return "Первая фигура имеет большую площадь, чем вторая."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лучше булевый результат возвращать, вместо строки. Иначе в вызвыающем коде придется писать проверки по типу if figure.compare(other_figure) == "Первая фигура имеет большую площадь, чем вторая.": ...

Comment thread 4/students.py

def get_scholarship(self):
if self.average_grade == 5:
return 6000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Хардкодить литералы плохо, нужно выносить в константы

Comment thread 4/students.py
print("Name: {}, Age: {}".format(self.name, self.age))

def get_scholarship(self):
if self.average_grade == 5:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Оценок тоже касается

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.

2 participants