Skip to content

Create a function to let the cat sleep #10

@nickmckay

Description

@nickmckay

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 the eat function in the Cat class in cat.py.
  • Edit the docstrings for this function, including usage a example.
  • Create a test for the new function.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions