In Python 2 I used:
print \"a=%d,b=%d\" % (f(x,n),g(x,n))
I\'ve tried:
print(\"a=%d,b=%d\") % (f(x,n),g(x,n))
Python 3.6 introduced f-strings for inline interpolation. What's even nicer is it extended the syntax to also allow format specifiers with interpolation. Something I've been working on while I googled this (and came across this old question!):
print(f'{account:40s} ({ratio:3.2f}) -> AUD {splitAmount}')
PEP 498 has the details. And... it sorted my pet peeve with format specifiers in other langs -- allows for specifiers that themselves can be expressions! Yay! See: Format Specifiers.