Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Created August 26, 2021 17:05
Show Gist options
  • Save pamelafox/fa1b27040050afc4e9c47b23be04b03a to your computer and use it in GitHub Desktop.
Save pamelafox/fa1b27040050afc4e9c47b23be04b03a to your computer and use it in GitHub Desktop.
Dog Age Calculator
"""
You know how old a dog is in human years, but what about dog years? Calculate it!
Write a function named calculate_dog_age that:
* takes 1 argument: a dog's age in human years.
* calculates the dog's age based on the conversion rate of 1 human year to 7 dog years.
* returns the age in dog years.
"""
def calculate_dog_age(years):
"""
>>> calculate_dog_age(1)
7
>>> calculate_dog_age(0.5)
3.5
>>> calculate_dog_age(12)
84
"""
# YOUR CODE HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment