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.