Skip to content

Commit

Permalink
'Solution'
Browse files Browse the repository at this point in the history
  • Loading branch information
tiron-vadym committed Oct 22, 2023
1 parent 34e3d33 commit acb88e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def shop_trip() -> None:
print("You have bought: ")
for item, quantity in customer.product_cart.items():
cost = best_shop.products[item] * quantity
if isinstance(cost, float) and cost.is_integer():
cost = int(cost)
if isinstance(cost, float) and cost.is_integer():
cost = int(cost)
print(f"{quantity} {item}s for {round(cost, 2)} dollars")
Expand All @@ -71,6 +73,7 @@ def shop_trip() -> None:
customer.money -= cheapest_cost

print(f"{customer.name} rides home")
print(f"{customer.name} now has {round(customer.money, 2)} dollars")
print(f"{customer.name} now has "
f"{round(customer.money, 2)} dollars\n")
else:
Expand Down

0 comments on commit acb88e7

Please sign in to comment.