-
Notifications
You must be signed in to change notification settings - Fork 697
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
base: master
Are you sure you want to change the base?
solution #580
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.
also your code style doesn't look good try to improve it
Use black
app/main.py
Outdated
print(f"Date: {_time.strftime('%d/%m/%Y %H:%M:%S')}") | ||
print(f"Thanks, {customer.name}, for your purchase!") | ||
print("You have bought:") |
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.
combine into one print()
please fix everywhere
app/main.py
Outdated
shops = [Shop(shop["name"], | ||
shop["location"], | ||
shop["products"]) | ||
for shop in data["shops"]] |
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.
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
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) |
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 use math.dist
No description provided.