Can I learn python in one month? Day 20

Adam Jones
2 min readMar 21, 2018

This evening I completed the final lesson of codecademy’s free python course. Overall I think it’s given me a decent grounding of how to use python, and whilst I’m sure there are many more complex features, I feel I’ve now got an idea of how to use it.

Earlier this week an opportunity presented itself to put some of my newly-learned python to the test. I had been looking at some financial metrics, and decided to try to calculate the IRR (internal rate of return) of a series of cashflows using python. This involves iterating on values for the annual discount rate to find the discount rate at which the NPV (Net Present Value) is zero. The point being that it can’t be calculated through solving an equation, but has to be through iterating a loop function — something which python is quite handy for. So I took a stab at it, and after maybe 45 minutes I’d managed to write a script which actually worked. There was definitely a sense of achievement and was feeling pretty pleased with myself in the way that I’d solved it. You can easily calculate the IRR through Excel or a Google spreadsheet but that’s not the point. Here’s the script:

Up until this point, I’ve primarily used python within a web UI on Codecademy, which includes an editor and a console. The next stage is going to be to actually try reading from and writing to files, so I can perform operations on existing datasets. This is going to be key for all three of my projects, so I’m hoping this won’t be too difficult to figure out.

Read the previous post here and the next post here

--

--