k4st
public python v1 · immuabletotal = 17865.24# we start from *just* before the fourth year's interest earningsfor n in range(0, 10): scholarship = (0.03 + (0.03 * n)) * total interest = 0.06 * total total = total - scholarship + interest print "year: %d\nn: %d\ninterest: %f\nscholarship: %f\nleft over: %f\n\n" \ % (n+4, n, interest, scholarship, total)