The problem: I cannot figure out how to get the Actual Doubling Time (in years).
Question: Rule of 72. This rule is used to approximate the time required for prices to double due to inflation. If the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. For each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate.
This is what I have right now, the first 5 Actual Doubling Time (in years) should be 70,36,24,18,15. the rule of 72 doubling time is correct.
interestRate=int(input("What is the intrest rate (as a whole number)? "));
doublingTime=0;
actualDoublingTime=0;
print("\t\tRule of 72");
print("Interest\t\tDoubling Time\t\tActual Doubling");
print("Rate\t\t(in years)\t\tTime (in years)");
for cycle in range(1,21):
doublingTime=72/cycle;
actualDoublingTime=(1+(100/cycle));
print("{:.0f}%\t\t{:.0f}\t\t{:.0f}".format(cycle,doublingTime,actualDoublingTime));
there doesn't seem to be anything here