Search code examples
pythonmultiplication

Can you take a look at the code below, It doesn't multiply the way I want to. 777777 instead of 21 for 7*3, for example. Please


Write a program that calculates your dogs age in “dog” years. Here is an example interaction between your program and the user:

How old is your dog: 3

Your dog is 21 in “dog” years.

my code:

age = input("How old is your dog: ")

dogage = age*7

print("Your dog is ",dogage," in dog years")

Solution

  • age = input("How old is your dog: ")
    
    dogage = int(age)*7
    
    print("Your dog is ",dogage," in dog years")