Advertisement
pacho_the_python

Untitled

Oct 10th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. budget_need = float(input())
  2.  
  3. price = 0
  4.  
  5. while price < budget_need:
  6.     cocktail_name = input()
  7.     if cocktail_name == "Party!":
  8.         break
  9.     cocktail_count = int(input())
  10.     price_per_order = len(cocktail_name) * cocktail_count
  11.     if price_per_order % 2 != 0:
  12.         price_per_order *= 0.75
  13.     price += price_per_order
  14.     if price >= budget_need:
  15.         break
  16.  
  17. if price >= budget_need:
  18.     club_income = price - budget_need
  19.     print("Target acquired.")
  20.     print(f"Club income - {price:.2f} leva.")
  21. else:
  22.     club_income = budget_need - price
  23.     print(f"We need {club_income:.2f} leva more.")
  24.     print(f"Club income - {price:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement