bl00dt3ars

09. Hello, France (Kalin Ka)

Jun 6th, 2021 (edited)
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. items_list = input().split("|")
  2. budget = float(input())
  3. purchases = 0
  4. sales = 0
  5.  
  6. for i in range(len(items_list)):
  7.     current_item = items_list[i].split("->")
  8.     type_of_item = current_item[0]
  9.     price_of_item = float(current_item[1])
  10.  
  11.     if ((type_of_item == "Clothes" and price_of_item <= 50.00) or (type_of_item == "Shoes" and price_of_item <= 35.00) \
  12.         or (type_of_item == "Accessories" and price_of_item <= 20.50)) and budget >= price_of_item:
  13.  
  14.         budget -= price_of_item
  15.         purchases += price_of_item
  16.         sold = price_of_item * 1.4
  17.         sales += sold
  18.         print(f"{sold:.2f}", end=" ")
  19.  
  20. print(f"\nProfit: {sales - purchases:.2f}")
  21. if sales + budget >= 150:
  22.     print("Hello, France!")
  23. else:
  24.     print("Time to go.")
Add Comment
Please, Sign In to add comment