Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #calculate the number of dog years from the age of a dog
- #
- age = input('Enter the age of your dog in years ')
- #convert string input to int type
- age_num = int(age)
- #multiply by 7 to claculate dog years
- dog_age = age_num * 7
- #convert that back to a string type ready to print
- dog_age_str = str(dog_age)
- #print it out
- print('Your dog is ' + dog_age_str + ' dog years old.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement