Skip to content

Commit

Permalink
"sol"
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenmarkotskyi committed Jul 21, 2024
1 parent 37201cb commit 56faf81
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,20 @@ def shop_trip() -> None:
config = json.load(file)

fuel_price = config["FUEL_PRICE"]
customers = []
shops = []

for config_customer in config["customers"]:
car = Car(
config_customer["car"]["brand"],
config_customer["car"]["fuel_consumption"]
)
customer = Customer(
config_customer["name"], config_customer["product_cart"],
config_customer["location"], config_customer["money"], car
)
customers.append(customer)

shops = [
Shop(config_shop["name"],
config_shop["location"],
config_shop["products"])
for config_shop in config["shops"]
]

customers = [
Customer(
config_customer["name"],
config_customer["product_cart"],
config_customer["location"],
config_customer["money"],
Car(**config_customer["car"])
)
for config_customer in config["customers"]
]

shops = [Shop(**config_shop) for config_shop in config["shops"]]
for customer in customers:
print(f"{customer.name} has {customer.money} dollars")
trips = []
Expand Down

0 comments on commit 56faf81

Please sign in to comment.