Skip to content

Commit

Permalink
add change location
Browse files Browse the repository at this point in the history
  • Loading branch information
taras-tkachuk committed Jun 1, 2024
1 parent 1991b23 commit 359fb4e
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 @@ -43,9 +43,12 @@ def shop_trip() -> None:
if customer.money >= min_price:
print(f"{customer.name} rides to "
f"{cheapest_shop.name}\n")
home_location = customer.location
customer.location = cheapest_shop.location
cheapest_shop.print_receipt(customer)
print(f"{customer.name} rides home\n{customer.name} now has "
f"{round(customer.money - min_price, 2)} dollars\n")
customer.location = home_location
else:
print(f"{customer.name} doesn't have enough money "
f"to make a purchase in any shop")

0 comments on commit 359fb4e

Please sign in to comment.