The problem with your code is that in Python 3 print is no longer a keyword, it's a function, so this happens:
>>> print ('%.2f') % 315.15321531321
%.2f
Traceback.... #
Because it prints the string and later evaluates the "% 315.15321531321" part and of course fails, the same occurs with the other examples.
This is ok:
print(('%.2f') % 315.15321531321)