我是 python 的初学者,这个作业要求我获得投资的未来价值。
p = raw_input("[How much did you invest?]:")
r = str(raw_input("[How much is the interest rate?]:"))
n = raw_input("[How long have you been investing?]:")
future_value = p*(1+1)**n
print "\n\n\tYour future value of your investment is: %s\n" % future_value
错误代码:
unsupported operand type(s) for ** or pow(): 'int' and 'str'
有什么帮助吗?