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>
You can do this by using raw string method by simply adding character 'r' without quotes before the string.
# to print '{I am inside braces}' print(r'{I am inside braces}')