Advertisement
viligen

hello_france

Oct 3rd, 2021
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. list_items = input().split("|")
  2. budget = float(input())
  3.  
  4. new_price = 0
  5. profit = 0
  6. sum_sold_items = 0
  7. list_element = []
  8. for index in range(len(list_items)):
  9.     list_element = list_items[index].split("->")
  10.     if (float(list_element[1]) <= budget) and ((list_element[0] == "Clothes" and float(list_element[1]) <= 50) or
  11.                                                 (list_element[0] == "Shoes" and float(list_element[1]) <= 35) or
  12.                                                 (list_element[0] == "Accessories" and float(list_element[1]) <= 20.50)):
  13.         new_price += 1.4 * float(list_element[1])
  14.         profit += 0.4 * float(list_element[1])
  15.         budget -= float(list_element[1])
  16.         sum_sold_items += new_price
  17.         print(f"{new_price:.2f}", end=" ")
  18.     new_price = 0
  19. print(f"\nProfit: {profit:.2f}")
  20. if budget + sum_sold_items >= 150:
  21.     print("Hello, France!")
  22. else:
  23.     print("Not enough money.")
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement