-1
data = f'"{name}": ' + "{" + tmp + "},"  

I have such a string, but I need so that I can use the string {} as for a variable or just as a string. What do I need to do for this?

Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91
  • Read the documentation for f-strings https://docs.python.org/3/reference/lexical_analysis.html#f-strings – DisappointedByUnaccountableMod May 20 '21 at 18:03
  • 2
    Does this answer your question? [How can I print literal curly-brace characters in a string and also use .format on it?](https://stackoverflow.com/questions/5466451/how-can-i-print-literal-curly-brace-characters-in-a-string-and-also-use-format) – Jonathan Feenstra May 20 '21 at 18:07

1 Answers1

3

You need double curly brackets

>>> print(f"{{}}")
{}
wjandrea
  • 28,235
  • 9
  • 60
  • 81
paulgavrikov
  • 1,883
  • 3
  • 29
  • 51