Spocoman

Club

Jan 7th, 2022 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. needed_sum = float(input())
  2. drink = input()
  3. profit = 0
  4.  
  5. while drink != 'Party!':
  6.     sum = len(drink) * float(input())
  7.     if sum % 2 == 1:
  8.         sum *= 0.75
  9.     profit += sum
  10.     if profit >= needed_sum:
  11.         break
  12.     drink = input()
  13.  
  14. if needed_sum > profit:
  15.     print(f'We need {needed_sum - profit:.2f} leva more.')
  16. else:
  17.     print('Target acquired.')
  18.  
  19. print(f'Club income - {profit:.2f} leva.')
  20.  
Add Comment
Please, Sign In to add comment