Advertisement
Spocoman

01. Guinea Pig

Nov 9th, 2023
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. food = float(input())
  2. hay = float(input())
  3. cover = float(input())
  4. weight = float(input())
  5.  
  6. for i in range(1, 31):
  7.     food -= 0.3
  8.     if i % 2 == 0:
  9.         hay -= food * 0.05
  10.     if i % 3 == 0:
  11.         cover -= weight / 3
  12.  
  13. if food < 0 or hay < 0 or cover < 0:
  14.     print("Merry must go to the pet store!")
  15. else:
  16.     print(f"Everything is fine! Puppy is happy! Food: {food:.2f}, Hay: {hay:.2f}, Cover: {cover:.2f}.")
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement