Very interesting read! However, wouldn’t the “remaining” amount of money be a more realistic parameter for allocating money in the interesting list? I used money / (2*len(interestlst))as moneyToAllocate because in reality, we cannot allocate currentvalue() / (2*len(interestlst)) always as some of it is already invested in our current portfolio, right (please correct me if I’m wrong)? Using half of the remaining money (“disposable money”) for allocation gives a profit of about 2400% at the end of twenty years — making about $24 million.

Also, I tried to make your code more Pythonic and optimize it, please have a look — I’d love your feedback! I’m trying to eliminate the use of global variables as they should be used sparingly.

Written by

Passionate. Pythonist. Perfectionist.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store