Dev with Serdar
Learn coding in Python, Go and Rust from Serdar Yegulalp, software dev specialist and senior writer at InfoWorld.
Python 3.14’s new template string feature
Overview
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.