blob: bdc5a3b2b474d86f9819b6cd0b448b0c4038292d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import sys
import os
import math
days_absent = int(input('Type the number of days that you wil be absent: '))
left_food_kg = float(input('Type the number of left food in kg: '))
daily_consumption_first = float(input('Type the daily consumption of the first cat in kg: '))
daily_consumption_second = float(input('Type the daily consumption of the second cat in kg: '))
left_food_kg -= days_absent * daily_consumption_first
left_food_kg -= days_absent * daily_consumption_second
if left_food_kg >= 0:
print('The cats are well fed')
print('{} kilos of food left'.format(left_food_kg))
else:
print('The cats are hungry')
print('{} more kilos of food are needed'.format(int(abs(left_food_kg))))
|