-
Notifications
You must be signed in to change notification settings - Fork 725
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 #678
base: master
Are you sure you want to change the base?
Solution #678
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Review my comment to improve your code!
app/car.py
Outdated
self.brand = brand | ||
self.fuel_consumption = fuel_consumption | ||
|
||
def fuel_needed_for_trip(self, distance: float | int) -> float | int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will return float every time, because you have division
app/customer.py
Outdated
|
||
def purchases_cost(self, products: dict[str, int]) -> float | int: | ||
costs = 0 | ||
for product in self.product_cart.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use keys
simply do for product in self.product_cart
app/customer.py
Outdated
def go_home(self) -> None: | ||
print(f"{self.name} rides home") | ||
print(f"{self.name} now has {self.money} dollars") | ||
print("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can call empty print without empty string
app/customer.py
Outdated
def go_buy(self, shop_name: str, costs_amount: float | int) -> None: | ||
self.money -= costs_amount | ||
print(f"{self.name} rides to {shop_name}") | ||
print("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can call empty print without empty string
app/shop.py
Outdated
current_time = datetime.datetime.now() | ||
current_time = current_time.strftime("%d/%m/%Y %H:%M:%S") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do it in one line
datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
No description provided.