擅长:python、mysql、java
<p>您好,您可以使用下面的代码</p>
<pre><code>birth = int(input('what year were you born in?'))
year = int(input('what year is it?'))
print((year-birth) , 'that is your age')
</code></pre>
<p>正如你所说的,int是你的出生和年份,程序会理解你是把2 int加在一起而不是字符串。另一件事是,您不能同时添加int和字符串,因此需要使用逗号</p>
<p>希望这有帮助!:D</p>