Coding Task: 02.02 Cat’s Years

In this exercise, you will write a program that converts your cat’s age to human years. A cat’s human age is approximately 7 times their age in cat’s years.

Your Task

In the editor below, fill in the blanks (________) so that the program calculates the age of a given cat in human years, and print the results back to the user.

Python Reference Sheet

Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:

Requirements

  • The program should run without any errors.
  • The program should calculate the age of a given cat and convert it to human years. A cat’s human age is approximately 7 times their age in cat’s years.
  • Hint: Don’t forget to convert the cat_age variable to an integer using the int() command, or you might get a weird result! What happens when you don’t convert the variable to an integer? Why do you think this happens?

Example

Below is an example of how the program should run:

Please enter your cat's name: Jasper
Please enter your cat's age: 2
In human years, Jasper is
14
year(s) old!
Scroll to Top