-
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
Develop #404
base: master
Are you sure you want to change the base?
Develop #404
Conversation
app/car.py
Outdated
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.
The file is still not fixed. Try to recreate the file and rewrite the code.
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.
File not fixed
app/customer.py
Outdated
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.
The file is still not fixed. Try to recreate the file and rewrite the code.
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.
File not fixed
I rewrote the code, but it still didn't help, I don't understand how to do it |
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.
Problems are not fixed
README.md
Outdated
|
||
|
||
#You want to create an application that helps customers to choose the cheapest |
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.
Why do you change this?
README.md
Outdated
|
||
|
||
### Note: Check your code using this [checklist](checklist.md) before pushing your solution. |
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.
Restore this code
app/car.py
Outdated
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.
File not fixed
app/customer.py
Outdated
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.
File not fixed
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.
This file was not fixed
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.
Restore changes on it
app/customer.py
Outdated
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.
app/shop.py
Outdated
if product in self.products: | ||
cost = self.products[product] * amount | ||
spent_money += cost | ||
if cost % 1 == 0: |
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 cost.is_integer()
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.
Not fixed
car.py
Outdated
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.
Why you also need duplicate of file?
castomer.py
Outdated
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.
Why you also need duplicate of file?
cer.py
Outdated
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.
Remove this file
app/customer.py
Outdated
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.
Remove this file BTW
app/castomer.py
Outdated
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.
Rename this file into customer.py
app/shop.py
Outdated
if product in self.products: | ||
cost = self.products[product] * amount | ||
spent_money += cost | ||
if cost % 1 == 0: |
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.
Not fixed
car.py
Outdated
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.
Remove this file.
castomer.py
Outdated
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.
Remove this file.
cer.py
Outdated
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.
Remove this file.
app/castomer.py
Outdated
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.
just rename this file.
app/customer.py
Outdated
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.
remove this file.
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.
Fix tests.
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.
Remove not needed files from git, please.
https://sentry.io/answers/delete-a-file-from-a-git-repository/
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 need to improve your files, because they are unreadable now
castomer.py
Outdated
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.
Delete this file, please
cer.py
Outdated
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.
Delete this file, pleaase
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 need to improve your files, because they are unreadable now
app/shop.py
Outdated
def generate_receipt(self, customer: str, current_time: str) -> str: | ||
receipt = f"Date: {current_time}\nThanks, {customer.name}," \ | ||
f" for your purchase!\nYou have bought: \n" | ||
total_cost = 0 | ||
for product, quantity in customer.product_cart.items(): | ||
if product in self.product_cart: | ||
product_cost = self.product_cart[product] | ||
product_total_cost = product_cost * quantity | ||
if product_total_cost % 1 == 0: | ||
receipt += ( | ||
f"{quantity} {product}s for " | ||
f"{int(product_total_cost)} dollars\n" | ||
) | ||
else: | ||
receipt += ( | ||
f"{quantity} {product}s for " | ||
f"{product_total_cost} dollars" | ||
) | ||
total_cost += product_total_cost | ||
receipt += f"\nTotal cost is {total_cost} dollars\nSee " \ | ||
f"you again!\n\n{customer.name} rides home" | ||
return receipt |
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.
def generate_receipt(self, customer: str, current_time: str) -> str: | |
receipt = f"Date: {current_time}\nThanks, {customer.name}," \ | |
f" for your purchase!\nYou have bought: \n" | |
total_cost = 0 | |
for product, quantity in customer.product_cart.items(): | |
if product in self.product_cart: | |
product_cost = self.product_cart[product] | |
product_total_cost = product_cost * quantity | |
if product_total_cost % 1 == 0: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{int(product_total_cost)} dollars\n" | |
) | |
else: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{product_total_cost} dollars" | |
) | |
total_cost += product_total_cost | |
receipt += f"\nTotal cost is {total_cost} dollars\nSee " \ | |
f"you again!\n\n{customer.name} rides home" | |
return receipt | |
def generate_receipt(self, customer: str, current_time: str, fuel_price: float) -> str: | |
receipt = f"Date: {current_time}\nThanks, {customer.name}," \ | |
f" for your purchase!\nYou have bought: \n" | |
total_cost = 0 | |
for product, quantity in customer.product_cart.items(): | |
if product in self.product_cart: | |
product_cost = self.product_cart[product] | |
product_total_cost = product_cost * quantity | |
if product_total_cost % 1 == 0: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{int(product_total_cost)} dollars\n" | |
) | |
else: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{product_total_cost} dollars" | |
) | |
total_cost = customer.calculate_trip_cost(self, fuel_price) | |
receipt += f"\nTotal cost is {total_cost} dollars\nSee " \ | |
f"you again!\n\n{customer.name} rides home" | |
return receipt |
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.
Small change
app/shop.py
Outdated
fuel_price: float | ||
) -> str: | ||
receipt = f"Date: {current_time}\nThanks, {customer.name}," \ | ||
f" for your purchase!\nYou have bought: \n" |
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.
f" for your purchase!\nYou have bought: \n" | |
f" for your purchase!\nYou have bought:\n" |
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.
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.
I tried your option, but then the test crashes, doesn't want to, a space is needed there
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.
the tests are fixed on git already. You have old version, so just remove the space here, please.
app/shop.py
Outdated
fuel_price: float | ||
) -> str: | ||
receipt = f"Date: {current_time}\nThanks, {customer.name}," \ | ||
f" for your purchase!\nYou have bought: \n" |
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.
the tests are fixed on git already. You have old version, so just remove the space here, please.
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.
Please restore this file!
app/main.py
Outdated
|
||
|
||
def shop_trip() -> str: | ||
global shop |
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.
Why do you need this line?
app/main.py
Outdated
shops_data = config_data["shops"] | ||
|
||
customers = [] | ||
cars = [] |
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.
This list is redundant no need to store cars
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.
sorry can't delete it
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.
app/shop.py
Outdated
total_cost = 0 | ||
for product in product_cart.keys(): | ||
total_cost += self.product_cart[product] * product_cart[product] |
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.
Use sum() function
Also, use .items instead of .keys()
app/shop.py
Outdated
if product_total_cost % 1 == 0: | ||
receipt += ( | ||
f"{quantity} {product}s for " | ||
f"{int(product_total_cost)} dollars\n" | ||
) | ||
else: | ||
receipt += ( | ||
f"{quantity} {product}s for " | ||
f"{product_total_cost} dollars" | ||
) |
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.
if product_total_cost % 1 == 0: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{int(product_total_cost)} dollars\n" | |
) | |
else: | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{product_total_cost} dollars" | |
) | |
if product_total_cost.is_integer(): | |
product_total_cost = int(product_total_cost) | |
receipt += ( | |
f"{quantity} {product}s for " | |
f"{product_total_cost} dollars" | |
) |
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.
Good job!
No description provided.