Advertisement
Spocoman

Cat Food

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