Skip to content

Commit

Permalink
clarify description
Browse files Browse the repository at this point in the history
  • Loading branch information
LLkaia committed Oct 25, 2024
1 parent 8256ec5 commit 4be7a71
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ package create modules:
This class should have only one static method `sell_product`,
that takes `product` - name of the product that customer wants
and `customer` - `Customer` instance, that means customer.
This method prints what product and to whom cinema sold.
`sell_product` method is responsible to sell product to customer,
and it prints what product and to whom cinema sold.


```python
cb = CinemaBar()
Expand All @@ -25,14 +27,16 @@ package create modules:

- `hall.py` - inside this module create `CinemaHall`
class that describes actions during the movie session. Its
`__init__` method takes and stores `number` - number of the hall
in cinema.
`__init__` method takes and stores `number` and only -
number of the hall in cinema.
This class should have only one method `movie_session`, that
takes `movie_name`, `customers` - list of a customers
(`Customer` instances), `cleaning_staff` - cleaner (`Cleaner`
instance). This method prints about movie start, calls
customers method `watch_movie`, prints about movie end,
calls cleaner method `clean_hall`.
calls cleaner method `clean_hall`. So, we are expecting
that everything listed above will be performed in `movie_session` function.

2. In directory `app` create package `people`. In this package
create modules:
- `customer.py` - inside this module create `Customer` class,
Expand All @@ -47,7 +51,7 @@ package create modules:
# Bob is watching "Madagascar".
```

- `cinema_staff` - inside this module create `Cleaner` class,
- `cinema_staff.py` - inside this module create `Cleaner` class,
its `__init__` method takes and stores `name`.
This class should have only one method `clean_hall`, this method
takes `hall_number` - number of hall that cleaner have to clean and
Expand All @@ -68,12 +72,14 @@ customer, `hall_number` - number of the hall in cinema,
`cleaner` - name of the cleaner, that will clean the
hall after movie session.

This function should make `Customers` instances, instance of `CinemaHall`
and `CinemaBar`, instance of `Cleaner`. First, cinema bar should sell food to
customers, then cinema hall should make a movie session and finally cleaner
cleans cinema hall.
This function should create `Customer` instances, instance of `CinemaHall`,
instance of `Cleaner`. First, cinema bar should sell food to
customers, and in order to do it you can use `CinemaBar` class without creation of its instance,
then cinema hall should make a movie session and finally cleaner
cleans cinema hall. We are expecting that each class already can work with provided data
(can accept parameters in the correct order, has needed methods. No need to additional checks and error handling.)

Example:
Example (do not add it to `main.py`):
```python
customers = [
{"name": "Bob", "food": "Coca-cola"},
Expand All @@ -82,7 +88,7 @@ customers = [
hall_number = 5
cleaner_name = "Anna"
movie = "Madagascar"
cinema_visit(customers=customers, hall_number=5, cleaner="Anna", movie="Madagascar")
cinema_visit(customers=customers, hall_number=hall_number, cleaner=cleaner_name, movie=movie)
# Cinema bar sold Coca-cola to Bob.
# Cinema bar sold popcorn to Alex.
# "Madagascar" started in hall number 5.
Expand All @@ -91,3 +97,7 @@ cinema_visit(customers=customers, hall_number=5, cleaner="Anna", movie="Madagasc
# "Madagascar" ended.
# Cleaner Anna is cleaning hall number 5.
```

**NOTE**: Each method which is responsible to perform something should just print a message using `print()` function.
No need to return something or use `logging` module. Finally, check your code using this [checklist](checklist.md)
before pushing your solution.
23 changes: 23 additions & 0 deletions checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Check Your Code Against the Following Points

1. If the function definition line is too long, place each parameter on a new line.
```
def long_function_name(
var_one,
var_two,
var_three,
var_four
) -> None:
```

2. Use absolute imports only.

Good example:
```python
from app.module import Component
```

Bad example:
```python
from .module import Component
```

0 comments on commit 4be7a71

Please sign in to comment.