Having a special value to enter to mark the end of input is a common
technique in programming. To do this one has to have something to
use for the sentinel which could not be another set of input.
As a first easy version, just to get used to the loop, you might put all the numbers in one list, and print it at the end.
Input an annual interest rate. Output the number of years it takes an account to double. It does not matter what stating value you use for the account. $1 is fine. Allow fractional cents in the account for simplicity.
For example, if you start with $1 and the interest rate is .2 each year, after each year you have (1 + .2) times as much as you had the year before.
year 1: 1.0(1 + .2) = 1.2
year 2: 1.2(1 + .2) = 1.44
year 3: 1.44(1 + .2) = 1.728
year 4: 1.728(1 + .2) = 2.0736
so the answer you print out would be 4 years. (This is also the amount of time for a debt to double if this is a credit card balance!)
Show your work to a TA.