2

Is there any way I can display {} as part of the f string as it has special meaning in f string. In other words:

If run print(f"hello world {}") , I want a results like hello world {}

My attempted solution is: print(f"hello world \{\}"). But it did not work.

A help will be much appreciated

Timur Shtatland
  • 9,559
  • 2
  • 24
  • 32
Dickson Afful
  • 319
  • 1
  • 12

1 Answers1

7

This should work

print(f"hello world {{}}")
dchoruzy
  • 197
  • 6