From a0addea2b7bbdac244420ec917c0f3c14c4c8831 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 30 Jun 2019 15:05:38 +0300 Subject: Added some of the stuff I have done while learning Python --- Python/Beginner training/004 TakingCare.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/Beginner training/004 TakingCare.py (limited to 'Python/Beginner training/004 TakingCare.py') diff --git a/Python/Beginner training/004 TakingCare.py b/Python/Beginner training/004 TakingCare.py new file mode 100644 index 0000000..47143a3 --- /dev/null +++ b/Python/Beginner training/004 TakingCare.py @@ -0,0 +1,15 @@ +import sys +import os +import math + +food = int(input('Type bought amount of food in kg: ')) * 1000 +days_care = int(input('Type days the the animals wil be taken care of: ')) + +for i in range(days_care): + daily_consumption = int(input('Food that the animal has eaten that day: ')) + food -= daily_consumption + +if food >= 0: + print('Food is enough! Leftovers: {} grams'.format(food)) +else: + print('Food is not enough. You need {} grams more'.format(abs(food))) \ No newline at end of file -- cgit v1.2.3