bl00dt3ars

04. Cat Food

Nov 14th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. cats = int(input())
  2.  
  3. small = 0
  4. big = 0
  5. large = 0
  6. total_food = 0
  7.  
  8. for i in range(cats):
  9.     food = float(input())
  10.     total_food += food
  11.     if 100 <= food < 200:
  12.         small += 1
  13.     elif 200 <= food < 300:
  14.         big += 1
  15.     elif 300 <= food < 400:
  16.         large += 1
  17.  
  18. price = total_food / 1000 * 12.45
  19.  
  20. print(f"Group 1: {small} cats.")
  21. print(f"Group 2: {big} cats.")
  22. print(f"Group 3: {large} cats.")
  23. print(f"Price for food per day: {price:.2f} lv.")
Add Comment
Please, Sign In to add comment