Thursday, 19 September 2013

Compound interest calculator: TypeError: unsupported operand type(s) for /: 'str' and 'str'

Compound interest calculator: TypeError: unsupported operand type(s) for
/: 'str' and 'str'

I'm quite new to Python and I was given the task of creating a compound
interest calculator. This is what I've come up with so far:
print ('Hello and welcome to Interest Calculator')
print ('Type in the amount of money you would like to calculate and do not
include the £ sign')
Capital = input()
print ('Now type in the interest rate without the % sign')
InterestRate = input()
Hundred = 100
InterestRate1 = InterestRate / Hundred
print ('Finally, type in the number of years you plan to leave your money
for')
NumberOfYears = input()
Rate = 1 + InterestRate1
Rate2 = pow(Rate, NumberOfYears)
CompoundInterest = Capital * Rate2
print (CompoundInterest)
But as soon as I click run, it tells me this:
TypeError: unsupported operand type(s) for /: 'str' and 'str'

No comments:

Post a Comment