你能看看下面的代码吗,它并没有按照我想要的方式相乘。例如,7*3 是 777777 而不是 21。请
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
编写一个程序,以“狗”年为单位计算您的狗的年龄。
这是您的程序与用户之间的示例交互:
你的狗多大了:3
你的狗在“狗”年是 21 岁。
我的代码:
age = input("How old is your dog: ")
dogage = age*7
print("Your dog is ",dogage," in dog years")
age = input("How old is your dog: ")
dogage = int(age)*7
print("Your dog is ",dogage," in dog years")
编写一个程序,以“狗”年为单位计算您的狗的年龄。 这是您的程序与用户之间的示例交互:
你的狗多大了:3
你的狗在“狗”年是 21 岁。
我的代码:
age = input("How old is your dog: ")
dogage = age*7
print("Your dog is ",dogage," in dog years")
age = input("How old is your dog: ")
dogage = int(age)*7
print("Your dog is ",dogage," in dog years")