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

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

Solution #1750

wants to merge 5 commits into from

Conversation

KishchukMaria
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.

Thank you for your hard work on this pull request! 😊 However, there are a few critical issues that need to be addressed to meet the task requirements:

  1. Static Method Requirement: The sell_product method in the CinemaBar class should be defined as a static method. Currently, it is not, which is a core requirement.

  2. Method Calls in movie_session: The movie_session method in the CinemaHall class incorrectly calls Customer.watch_movie() and Cleaner.clean_hall() without using instances. You need to iterate over the customers list and call watch_movie on each Customer instance, and call clean_hall on the Cleaner instance.

  3. Incorrect Method Usage in cinema_visit: The sell_product method should be called as a static method, not on an instance of CinemaBar. Additionally, the movie_session method is called with incorrect parameters; it should receive a list of Customer instances and a Cleaner instance.

  4. Parameter Type: The customers parameter should be a list of Customer instances, not a single instance. Update the parameter type and iterate over this list to call watch_movie on each customer.

These changes are necessary to ensure the code functions correctly and meets the task requirements. Once these issues are resolved, your code will be in great shape! Keep up the good work, and feel free to reach out if you have any questions or need further assistance. 🌟

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

def __init__(self, number: int):
self.number = number

def movie_session(self, movie_name: str, customers: Customer, cleaning_staff: Cleaner):

Choose a reason for hiding this comment

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

The customers parameter should be a list of Customer instances, not a single Customer instance. Update the parameter type to List[Customer] and iterate over this list to call watch_movie on each customer.


def movie_session(self, movie_name: str, customers: Customer, cleaning_staff: Cleaner):
print(f"{movie_name} started in hall number {self.number}.")
Customer.watch_movie()

Choose a reason for hiding this comment

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

The method watch_movie should be called on each Customer instance, not on the Customer class. Iterate over the customers list and call customer.watch_movie(movie_name) for each customer.

print(f"{movie_name} started in hall number {self.number}.")
Customer.watch_movie()
print(f"{movie_name} ended.")
Cleaner.clean_hall(self.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 should be called on the cleaning_staff instance, not on the Cleaner class. Use cleaning_staff.clean_hall(self.number) instead.

app/main.py Outdated
for element in customers:
result_list.append(Customer(element["name"], element["food"]))
for customer in result_list:
CinemaBar.sell_product(customer.food, customer)

Choose a reason for hiding this comment

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

The sell_product method should be called as a static method of CinemaBar, not as an instance method. Use CinemaBar().sell_product(customer.food, customer) instead.

app/main.py Outdated
for customer in result_list:
CinemaBar.sell_product(customer.food, customer)
for element in result_list:
CinemaHall.movie_session(movie, element.name, cleaner)

Choose a reason for hiding this comment

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

The movie_session method should be called with a list of Customer instances and a Cleaner instance. Update the call to CinemaHall(hall_number).movie_session(movie, result_list, Cleaner(cleaner)).

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 effort on your submission! 🎉 While your code has some issues, such as the sell_product method in the CinemaBar class needing to be defined and called as a static method, it's important to address these to meet the task requirements. The cinema_visit function also needs adjustment to call sell_product correctly. These changes are crucial for the functionality of your code. Remember, addressing these issues will help you improve and learn. Keep up the good work, and don't hesitate to review the comments to enhance your code further. You're on the right track! 🚀

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


class CinemaBar:

def sell_product(self, product: str, customer: Customer) -> None:

Choose a reason for hiding this comment

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

The sell_product method should be defined as a static method. You can do this by using the @staticmethod decorator above the method definition. This change is necessary to meet the task requirement that specifies sell_product should be a static method.

result_list.append(Customer(element["name"], element["food"]))
cinema_bar = CinemaBar()
for customer in result_list:
cinema_bar.sell_product(customer.food, customer)

Choose a reason for hiding this comment

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

The sell_product method should be called as a static method. Instead of using cinema_bar.sell_product(...), you should call it using CinemaBar.sell_product(...). This change is necessary to align with the task requirement that specifies sell_product should be a static method.

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