exDotaPro

2019_6_july_4_club

Feb 1st, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. target = float(input())
  2. command = input()
  3.  
  4. income = 0
  5.  
  6. while command != 'Party!':
  7.     cocktail_name = command
  8.     cocktail_count = int(input())
  9.  
  10.     cocktail_price = len(cocktail_name) * cocktail_count
  11.     cocktail_last_digit = cocktail_price % 10
  12.  
  13.     if cocktail_last_digit % 2 != 0:
  14.         cocktail_price *= 0.75
  15.         income += cocktail_price
  16.         target -= cocktail_price
  17.     else:
  18.         income += cocktail_price
  19.         target -= cocktail_price
  20.  
  21.     if target <= 0:
  22.         print('Target acquired.')
  23.         print(f'Club income - {income:.2f} leva.')
  24.         break
  25.  
  26.     command = input()
  27.  
  28.     if command == 'Party!':
  29.         print(f'We need {target:.2f} leva more.')
  30.         print(f'Club income - {income:.2f} leva.')
Advertisement
Add Comment
Please, Sign In to add comment