There's more...
You may have also seen the available Python formatting with the % operator. While it works for simple formatting, it is less flexible than the formated mini-language, and it is not recommended for use.
A great new feature since Python 3.6 is to use f-strings, which perform a format action using defined variables this way:
>>> param1 = 'first'
>>> param2 = 'second'
>>> f'Parameters {param1}:{param2}'
'Parameters first:second'
This simplifies a lot of the code and allows us to create very descriptive and readable code.
If you need to write a curly bracket, you'll need to repeat it twice. Note that each duplication will be displayed as a single curly bracket, plus a curly bracket for the value replacement, making a total of three brackets:
>>value = 'VALUE'
>>> f'This is the value, in curly brackets {{{value}}}'
'This is the value, in curly brackets {VALUE}'
This allows us to create meta templates—templates that produce templates. In some cases, that will be useful, but try to limit their use, as they'll get complicated very quickly, producing code that will be difficult to read.
The Python Format Specification mini-language has more options than the ones shown here.
Please check the full documentation and examples on the Python website (https://docs.python.org/3/library/string.html#formatspec).