This module calculates the US premium tax credit for individual health-insurance premiums under the ACA act (a.k.a. "obamacare"). The ".txt" file here also gives example output, per __main__ code.
This was written in 2013 when there were still few ACA resources, and the ACA itself now seems destined to fall victim to a new US government (perhaps: it's not dead yet). This is presented only as an example of simple math in Python -- not tax advice!
This code was also something of a prototype, eventually translated to VBA macros (user-defined functions) for use in Excel spreadsheets. There are all-Python options for Excel too; see the web for pointers.