#quote from 'introduction to computation and programming using python,
# revised edition, MIT'
import pylab
principle = 10000 #initial investment
interestRate = 0.05
years = 20
values = []
for i in range(years + 1):
values.append(principle)
principle += principle*interestRate
pylab.plot(values)
pylab.title('5% Growth, Coumpounded Annually')
pylab.xlabel('Years of Compounding')
pylab.ylabel('Value of Principle ($)')
pylab.show()
another pylab demo
最新推荐文章于 2018-06-22 10:48:58 发布