I’ve made a program that calculates the flat rate interest of a loan based on the amount borrowed, the %/year (interest), and the length of time to pay it back…
here’s where my problem starts:
I let the user input the years to pay it back, BUT, if the length of time is under a year the user is forced to use a decimal like “0.5” for example and it reads as an error “invalid literal for int() with base 10: ‘0.5’”, am I forgetting to do something???
I’ve made a program that calculates the flat rate interest of a loan based
Share
Maybe
float("0.5")? that might be more suited to your problem.