Skip to content
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

Develop #1348

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Develop #1348

wants to merge 4 commits into from

Conversation

JurassicGen
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the task requirements! 🎉 The code is mostly correct and meets the core requirements. There are a couple of minor improvements you could consider: correcting the typo from hummer_level to hammer_level in the DwarfWarrior class and optimizing the calculate_team_total_rating function by using a generator expression. Keep up the good work and happy coding! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨



def calculate_team_total_rating(team: list[Player]) -> int:
return sum([player.get_rating() for player in team])

Choose a reason for hiding this comment

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

The calculate_team_total_rating function uses a list comprehension inside the sum function, which creates a redundant list. According to the checklist, you should prevent creating a redundant list by using a generator expression instead. Change [player.get_rating() for player in team] to (player.get_rating() for player in team) to improve efficiency .

class DwarfWarrior(Dwarf):
def __init__(self, nickname: str,
favourite_dish: str,
hummer_level: int) -> None:

Choose a reason for hiding this comment

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

There is a typo in the parameter name hummer_level. It should likely be hammer_level to reflect the intended meaning. This change should be applied consistently throughout the class.

favourite_dish: str,
hummer_level: int) -> None:
super().__init__(nickname, favourite_dish)
self._hummer_level = hummer_level

Choose a reason for hiding this comment

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

The attribute _hummer_level seems to have a typo. It should likely be _hammer_level to reflect the intended meaning.

self._hummer_level = hummer_level

def get_rating(self) -> int:
return self._hummer_level + 4

Choose a reason for hiding this comment

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

The attribute _hummer_level seems to have a typo. It should likely be _hammer_level to reflect the intended meaning.


def player_info(self) -> str:
return (f"Dwarf warrior {self.nickname}. "
f"{self.nickname} has a hummer of the "

Choose a reason for hiding this comment

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

The word hummer in the string should likely be hammer to reflect the intended meaning.

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