Boltzmann Partition Function Python Format