0

I try:

'TEST{0}: {TEMP}'.format("_TEST")

and result:

KeyError: 'TEMP

How to recived something like that by format:

'TEST_TEST: {TEMP}'
user7172
  • 874
  • 4
  • 16
  • 31

1 Answers1

3

You can use double {{ and }} to escape { and } . Example -

>>> 'TEST{0}: {{TEMP}}'.format("_TEST")
'TEST_TEST: {TEMP}'
Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176