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

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

Solution #678

wants to merge 3 commits into from

Conversation

Dogober
Copy link

@Dogober Dogober commented Dec 27, 2024

No description provided.

Copy link

@L1nk3rrr L1nk3rrr left a 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:
Copy link

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():
Copy link

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("")
Copy link

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("")
Copy link

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
Comment on lines 18 to 19
current_time = datetime.datetime.now()
current_time = current_time.strftime("%d/%m/%Y %H:%M:%S")
Copy link

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")

@Dogober Dogober requested a review from L1nk3rrr January 2, 2025 17:17
Copy link

@L1nk3rrr L1nk3rrr left a comment

Choose a reason for hiding this comment

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

Nice job!

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