Advertisement
Andonoff

Hello, France!

Jun 6th, 2025
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.45 KB | None | 0 0
  1. collection_of_items = input().split("|")
  2. budget = float(input())
  3. selling_price_list = []
  4. ticket = 150
  5. total_selling_sum = 0
  6. total_shopping_sum = 0
  7.  
  8. for item in collection_of_items:
  9.     new_item = item.split("->")
  10.     current_item = new_item[0]
  11.     current_price = float(new_item[1])
  12.  
  13.     if budget < current_price:
  14.         continue
  15.     if current_item == "Clothes" and current_price <= 50.00:
  16.         budget -= current_price
  17.         total_shopping_sum += current_price
  18.         selling_price = current_price + 0.4 * current_price
  19.         total_selling_sum += selling_price
  20.         selling_price_list.append(f"{selling_price:.2f}")
  21.  
  22.     if current_item == "Shoes" and current_price <= 35.00:
  23.         budget -= current_price
  24.         total_shopping_sum += current_price
  25.         selling_price = current_price + 0.4 * current_price
  26.         total_selling_sum += selling_price
  27.         selling_price_list.append(f"{selling_price:.2f}")
  28.  
  29.     if current_item == "Accessories" and current_price <= 20.50:
  30.         budget -= current_price
  31.         total_shopping_sum += current_price
  32.         selling_price = current_price + 0.4 * current_price
  33.         total_selling_sum += selling_price
  34.         selling_price_list.append(f"{selling_price:.2f}")
  35.  
  36. final_budget = budget + total_selling_sum
  37.  
  38. print(" ".join(selling_price_list))
  39. profit = total_selling_sum - total_shopping_sum
  40.  
  41. print(f"Profit: {profit:.2f}")
  42.  
  43. if final_budget >= ticket:
  44.     print(f"Hello, France!")
  45. else:
  46.     print(f"Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement