Duality Group interview question

How to do some simple financial computations in python.