Advertisement
BbJLeB

4. Bachelor Party

May 29th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. # 4. Bachelor Party
  2.  
  3. guest = int(input())
  4. guests_counter = 0
  5. end_price = 0
  6.  
  7. while guest > 0:
  8.     group = input()
  9.     if group != "The restaurant is full":
  10.         if int(group) < 5:
  11.             guests_counter += int(group)
  12.             price = int(group) * 100
  13.             end_price += price
  14.         if int(group) >= 5:
  15.             guests_counter += int(group)
  16.             price = int(group) * 70
  17.             end_price += price
  18.     else:
  19.         break
  20. if guest > end_price:
  21.     total = guest - end_price
  22.     print(f"You have {guests_counter} guests and {end_price} leva income, but no singer.")
  23. else:
  24.     total = end_price - guest
  25.     print(f"You have {guests_counter} guests and {total} leva left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement