Write a function called sleep() to let the cat sleep. This function needs a parameter called "duration" where the user enters the number of hours that cat sleeps. This value must be positive and cannot exceed 16 hours, and should return an error if it does. For every 3 hours the cat sleeps its energy level increases by 1.
Write a function called
sleep()to let the cat sleep. This function needs a parameter called "duration" where the user enters the number of hours that cat sleeps. This value must be positive and cannot exceed 16 hours, and should return an error if it does. For every 3 hours the cat sleeps its energy level increases by 1.cat.py.