Python has long had the “f-string” feature, for creating formatted strings from variable data. Now, with Python 3.14, there’s a “template string” type — an f-string-like construction which gives you far more control over how the data is formatted and outputted. In this example we show how t-strings (as they’re called) can be used to create templates that safely format text for HTML output.