Created
August 26, 2021 17:05
-
-
Save pamelafox/fa1b27040050afc4e9c47b23be04b03a to your computer and use it in GitHub Desktop.
Dog Age Calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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