Advertisement
Osiris1002

Guinea Pig

Feb 13th, 2024
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. amount_of_food = float(input()) * 1000
  2. amount_of_hay = float(input()) * 1000
  3. amount_of_cover = float(input()) * 1000
  4. weight_of_pigs = float(input()) * 1000
  5. consumables = True
  6. days = 30
  7.  
  8. while True:
  9.     days -= 1
  10.     amount_of_food -= 300
  11.     if amount_of_food <= 0:
  12.         consumables = False
  13.         break
  14.     if days % 2 == 0:
  15.         amount_of_hay -= amount_of_food * 0.05
  16.         if amount_of_hay <= 0:
  17.             consumables = False
  18.             break
  19.     if days % 3 == 0:
  20.         amount_of_cover -= weight_of_pigs / 3
  21.         if amount_of_cover <= 0:
  22.             consumables = False
  23.             break
  24.     if days == 0:
  25.         break
  26.  
  27. if not consumables:
  28.     print("Merry must go to the pet store!")
  29. else:
  30.     print(f"Everything is fine! Puppy is happy! Food: {amount_of_food / 1000:.2f}, Hay: {amount_of_hay / 1000:.2f}, Cover: {amount_of_cover / 1000:.2f}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement