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

Solution #604

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

Solution #604

wants to merge 2 commits into from

Conversation

andriiovod
Copy link

No description provided.

app/main.py Outdated
Comment on lines 66 to 75
try:
limitations = self.limitation_class(visitor.age,
visitor.weight, visitor.height)
return (
limitations.age >= visitor.age
and limitations.weight >= visitor.weight
and limitations.height >= visitor.height
)
except ValueError:
return False
Copy link

Choose a reason for hiding this comment

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

Suggested change
try:
limitations = self.limitation_class(visitor.age,
visitor.weight, visitor.height)
return (
limitations.age >= visitor.age
and limitations.weight >= visitor.weight
and limitations.height >= visitor.height
)
except ValueError:
return False
def can_access(self, visitor: Visitor) -> bool:
try:
self.limitation_class(visitor.age, visitor.weight, visitor.height)
return True
except ValueError:
return False

app/main.py Outdated
Comment on lines 47 to 51
def __init__(self, age: int, weight: int, height: int) -> None:
super().__init__(age, weight, height)
self.age = age
self.weight = weight
self.height = height
Copy link

Choose a reason for hiding this comment

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

__init__ redundant here

and fixed method 'can_access'.
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