Advertisement
fumanbest

Bachelor Party

Jun 16th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. singer_cost = int(input())
  2. guests = 0
  3. total_budget = 0
  4.  
  5. while True:
  6.     incoming_guests = input()
  7.     if incoming_guests == "The restaurant is full":
  8.         break
  9.     incoming_guests = int(incoming_guests)
  10.     if incoming_guests < 5:
  11.         guests += incoming_guests
  12.         total_budget += incoming_guests * 100
  13.     else:
  14.         guests += incoming_guests
  15.         total_budget += incoming_guests * 70
  16.  
  17. diff = total_budget - singer_cost
  18. if diff >= 0:
  19.     print(f"You have {guests} guests and {diff} leva left.")
  20. else:
  21.     print(f"You have {guests} guests and {total_budget} leva income, but no singer.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement