komodo edit ValueError: could not convert string to float:

153 Views Asked by At

Here is my source code using Python 2.7 in Komodo edit on a Macbook Pro.

x=float(raw_input('Enter the outstanding balance on the credit card:'))
y=float(raw_input("Enter the annual credit card interest rate as a decimal:"))
z=float(raw_input("Enter the minimum monthly payment rate as a decimal:"))

month=1

while month<=12:
 minimum=x*z
 interest=y/12*x
 principal=minimum-interest
 x=x-principal
 print minimum
 print principal
 print x
 month += 1

Everytime I enter a value for y, the value Error: could not convert string to float: alert comes up. I'm following the MIT open courseware and it happened even with the model solution for the problem set. How should I fix this?

Many thanks

0

There are 0 best solutions below