x = \" \\{ Hello \\} {0} \" print(x.format(42))
gives me : Key Error: Hello\\\\
Key Error: Hello\\\\
I want to print the output: {Hello} 42>
{Hello} 42>
Use escape sequences to escape the curly braces in the f-string. Ex:print(f'{a={1}}')