Learning math the python way (?)