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

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

solution #580

wants to merge 3 commits into from

Conversation

haldaniko
Copy link

No description provided.

Copy link
Contributor

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

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

also your code style doesn't look good try to improve it
Use black

app/main.py Outdated
Comment on lines 52 to 54
print(f"Date: {_time.strftime('%d/%m/%Y %H:%M:%S')}")
print(f"Thanks, {customer.name}, for your purchase!")
print("You have bought:")
Copy link
Contributor

Choose a reason for hiding this comment

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

combine into one print()
please fix everywhere

app/main.py Outdated
Comment on lines 20 to 23
shops = [Shop(shop["name"],
shop["location"],
shop["products"])
for shop in data["shops"]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
shops = [Shop(shop["name"],
shop["location"],
shop["products"])
for shop in data["shops"]]
shops = [Shop(**shop) for shop in data["shops"]]

app/customer.py Outdated
Comment on lines 18 to 24
fuel_price: float) -> float:
distance = math.sqrt(
(self.location[0] - shop_location[0]) ** 2
+ (self.location[1] - shop_location[1]) ** 2
)
return round((distance / 100)
* self.car.fuel_consumption * 2 * fuel_price, 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use math.dist

@haldaniko haldaniko requested a review from vsmutok May 31, 2024 13:44
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.

3 participants