Format strings contain “replacement fields” surrounded by curly braces {}. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the literal text, it can be escaped by doubling: {{ and }}.
You need to double the
{{
and}}
:Here's the relevant part of the Python documentation for format string syntax:
Try this:
x = "{{ Hello }} {0}"
If you are going to be doing this a lot, it might be good to define a utility function that will let you use arbitrary brace substitutes instead, like
Note that this will work either with brackets being a string of length 2 or an iterable of two strings (for multi-character delimiters).