"If I had £0 at the beginning of 2013, and I gained £50 a week, lost one fifth of all my money every month, and every leap year, one quarter of the money I had lost gets returned. How much money would I have at the end of 10 years?"

This is the question my friend asked me to figure out. I have attempted to write a program, but it only returns "26000.0". Something has gone wrong. Here is my code, and if someone could to kind enough to tell me what the problem is, I would be most grateful.

- Code: Select all
`total = 0`

weeksleft = 520

monthsleft = weeksleft/4

gone = 0

to_go = total/5

while weeksleft > 0:

if weeksleft > 0:

weeksleft = weeksleft -1

total = total + 50

if monthsleft%1 == 0:

total = total - (to_go)

gone = gone + to_go

if weeksleft == 312:

total = total + (gone/4)

if weeksleft == 104:

total = total + (gone/4)\

print(total)

Thanks!

Jake