Python Calculations With Variable Cost