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 #1433

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

Solution #1433

wants to merge 2 commits into from

Conversation

SerhiyNecha
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 your code! While there are some minor improvements that can be made, none of them significantly impact the functionality of your code. Keep up the good work! 😊 Remember, always strive to improve your code quality and readability. Don't forget to consider the suggestions for your future tasks. Keep coding! 🚀

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

Comment on lines +7 to +8
def __init__(self, number: int) -> None:
self.number = number

Choose a reason for hiding this comment

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

It's a good practice to add docstrings in your classes and methods. Even though your class and method names are descriptive, it's always a good idea to add a docstring explaining what the class or method does. This is especially useful for other developers who might use your code.

Comment on lines +10 to +11
def movie_session(self, movie_name: str, customers: list[Customer],
cleaning_staff: Cleaner) -> None:

Choose a reason for hiding this comment

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

You are using a list of Customer objects and a Cleaner object as parameters to the movie_session method. It would be a good idea to check if these parameters are of the expected types before using them. This will make your code more robust and prevent potential bugs.

Comment on lines +13 to +17
print(f'"{movie_name}" started in hall number {self.number}.')
for customer in customers:
customer.watch_movie(movie_name)
print(f'"{movie_name}" ended.')
cleaning_staff.clean_hall(self.number)

Choose a reason for hiding this comment

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

You are using print statements for logging the start and end of the movie. This is fine for a small program, but in a larger application, it's better to use a logging framework. This will give you more control over the logging level, format, and destination. Additionally, it's a good idea to separate the logic of handling customers and cleaning staff. This will make your code more modular and easier to test and maintain.

app/main.py Outdated
# write you code here
pass
def cinema_visit(customers: list, hall_number: int,
cleaner: str, movie: str) -> None:

Choose a reason for hiding this comment

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

The function signature is not very clear. It's not obvious what 'cleaner' argument is supposed to be. It would be better to rename it to 'cleaner_name' to make it more explicit.

app/main.py Outdated
Comment on lines 15 to 18
for bar_sell in customers:
customer = Customer(bar_sell["name"], bar_sell["food"])
list_of_customer.append(customer)
bar_func.sell_product(product=bar_sell["food"], customer=customer)

Choose a reason for hiding this comment

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

The variable name 'bar_sell' is not very descriptive, it would be better to rename it to something more meaningful, like 'customer_info'.

list_of_customer.append(customer)
bar_func.sell_product(product=bar_sell["food"], customer=customer)

CinemaHall.movie_session(self=hall, movie_name=movie,

Choose a reason for hiding this comment

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

The 'self' parameter is not needed when calling a method on an instance. You should remove it.

app/main.py Outdated
hall_number = 5
cleaner = "Anna"
movie = "Madagascar"
cinema_visit(customers=customers, hall_number=5,

Choose a reason for hiding this comment

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

You're using hardcoded values for 'hall_number' and 'cleaner' arguments here, but you have already defined variables for these values. You should use the variables instead.

class Cleaner:

def __init__(self, name: str) -> None:
self.name = name

Choose a reason for hiding this comment

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

It's a good practice to use type hinting for instance variables as well. In this case, you can add ': str' to 'self.name' for better readability and maintainability of the code. For example: 'self.name: str = name'.

self.name = name

def clean_hall(self, hall_number: int) -> None:
print(f"Cleaner {self.name} is cleaning hall number {hall_number}.")

Choose a reason for hiding this comment

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

The method 'clean_hall' currently prints a message to the console. While this is fine for testing, in a real-world application, you might want to consider logging this information instead of printing it. This would allow you to keep track of the cleaning activities in a more structured way.

Copy link

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

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

Great!

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