Advertisement
miglenabs

Untitled

Nov 19th, 2022
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. wanted_profit = float(input())
  2. flag = False
  3.  
  4. total_income = 0
  5. income = 0
  6. price = 0
  7. input_line = input()
  8. while input_line != "Party!":
  9.     name = input_line
  10.     count = int(input())
  11.     price = len(name)
  12.     if price % 2 != 0:
  13.         price = price - (price * 0.25)
  14.     income = price * count
  15.     total_income = total_income + income
  16.     if flag:
  17.         print("Target acquired.")
  18.         print(f"Club income - {total_income:.2f} leva.")
  19.         break
  20.     input_line = input()
  21.  
  22. if input_line == "Party":
  23.     diff = abs(wanted_profit - total_income)
  24.     print("We need {diff:.2f} leva more.")
  25.     print(f"Club income - {total_income:.2f} leva.")
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement