Before going farther and look at the way to deal with loops, you should fix issues regarding your variables.
Keep variable name short : for example, "initialmonthlyballance" is too long, and it is prone to typo error (see the way you wrote "ballance")
Keep the same name. There is a variable called "y" coming from nowhere at line 11. Same remark apply for a variable "x10" at line 9 and 18. You probably renamed these variables somewhere, but forgot these places.
Use existing variable. At line 3 you create "monthlyrate" but still, you recalculate the monthly rate at line 8. Why not using existing "monthlyrate" ?
Generally, if you want to manipulate a variable, this variable must exist. Here, at line 6, you create a loop based on the value of a variable called "remainder", but such variable does not exist... How can Python check its value if its not stated elsewhere before ?