Skip to content

Commit

Permalink
'fix-flake8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldar committed Sep 27, 2024
1 parent 7400d50 commit 73ed08a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
class Car:
def __init__(self, comfort_class, clean_mark, brand) -> None:
def __init__(self,
comfort_class: int,
clean_mark: int,
brand: str
) -> None:

self.comfort_class = comfort_class
self.clean_mark = clean_mark
self.brand = brand
Expand All @@ -8,10 +13,10 @@ def __init__(self, comfort_class, clean_mark, brand) -> None:
class CarWashStation:
def __init__(
self,
distance_from_city_center,
clean_power,
average_rating,
count_of_ratings
distance_from_city_center: int | float,
clean_power: int | float,
average_rating: int | float,
count_of_ratings: int | float
) -> None:

self.distance_from_city_center = distance_from_city_center
Expand All @@ -23,7 +28,10 @@ def calculate_washing_price(self, car: Car) -> float:
if car.clean_mark >= self.clean_power:
return 0

return round(car.comfort_class * (self.clean_power - car.clean_mark) * self.average_rating / self.distance_from_city_center, 1)
return round(
(car.comfort_class * (self.clean_power - car.clean_mark)
* self.average_rating) / self.distance_from_city_center, 1
)

def wash_single_car(self, car: Car) -> None:
if car.clean_mark < self.clean_power:
Expand All @@ -44,5 +52,3 @@ def rate_service(self, new_rating: float) -> None:
total_ratings += new_rating
self.count_of_ratings += 1
self.average_rating = round(total_ratings / self.count_of_ratings, 1)


0 comments on commit 73ed08a

Please sign in to comment.