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

created animals classes #561

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

Conversation

vsafian
Copy link

@vsafian vsafian commented Jul 10, 2023

No description provided.

app/main.py Outdated
Comment on lines 17 to 18
points = self.appetite
self.appetite = 0

Choose a reason for hiding this comment

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

Not said that we need to change it to 0

app/main.py Outdated
print(f"Hello, I'm {self.name}")

def feed(self) -> int:
if self.appetite and self.is_hungry:

Choose a reason for hiding this comment

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

Suggested change
if self.appetite and self.is_hungry:
if self.is_hungry:

Not need to check by self.appetite

app/main.py Outdated
Comment on lines 24 to 25
def __init__(self, name: str, is_hungry: bool = True,
appetite: int = 3) -> None:

Choose a reason for hiding this comment

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

Suggested change
def __init__(self, name: str, is_hungry: bool = True,
appetite: int = 3) -> None:
def __init__(
self, name: str, appetite: int = 3, is_hungry: bool = True
) -> None:

No need to change order of params

app/main.py Outdated
Comment on lines 36 to 37
def __init__(self, name: str, is_hungry: bool = True,
appetite: int = 7) -> None:

Choose a reason for hiding this comment

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

Suggested change
def __init__(self, name: str, is_hungry: bool = True,
appetite: int = 7) -> None:
def __init__(
self, name: str, appetite: int = 7, is_hungry: bool = True
) -> None:



class Cat(Animal):
def __init__(self, name: str,

Choose a reason for hiding this comment

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

image
init must get only 2 arguments without appetite, rewrite it

Choose a reason for hiding this comment

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

the same with Dog

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