Skip to content

Exam Solution#2

Open
IvanShugarov wants to merge 6 commits into
mainfrom
develop
Open

Exam Solution#2
IvanShugarov wants to merge 6 commits into
mainfrom
develop

Conversation

@IvanShugarov

Copy link
Copy Markdown
Owner

No description provided.

Comment thread Sprint_1/task_4.py
new_tasks = ['task_001', 'task_011', 'task_007', 'task_015', 'task_005']
completed_tasks = ['task_002', 'task_012', 'task_006']

completed_tasks.append(new_tasks.pop(-1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно проще: completed_tasks.append(new_tasks.pop())
Так как pop() по умолчанию удаляет последний элемент

Comment thread Sprint_2/task_1.py Outdated
super().__init__(test_case_id, name, step_description, expected_result)

def print_test_case_info(self):
print(f"ID тест-кейса: {self.test_case_id}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нужно исправить: Частично этот вывод уже описан в родительском классе, можно вызвать его оттуда, а не дублировать код

Comment thread Sprint_2/task_2.py Outdated
class Comedy(Movie):

def add_movie(self,movie):
self.movies.append(movie)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нужно исправить: Метод уже описан в классе-родителе. Тут должен быть его вызов через super() и дописан необходимый return Иначе теряется весь смысл наследования

Comment thread Sprint_2/task_3.py Outdated
def get_points_for_place(place):
if place > 100:
print("Баллы начисляются только первым 100 участникам")
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

логичнее возвращать points зачем то же мы им дали дефолтное значение

Comment thread Sprint_2/task_3.py Outdated
class TotalPoints(PointsForPlace, PointsForMeters):
@staticmethod
def get_total_points(meters,place):
total = PointsForPlace.get_points_for_place(place) + PointsForMeters.get_points_for_meters(meters)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нужно исправить: get_points_for_place и .get_points_for_meters теперь методы TotalPoints после наследования, обращение к ним ведется через self

Comment thread Sprint_2/task_5.py
return f"Хоккейных поражений: {self.losses}"

def total_points(self):
points = 2 * self.victories + self.draws

Copy link
Copy Markdown

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.

3 participants