0

I try:

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

and result:

KeyError: 'TEMP

How to recived something like that by format:

'TEST_TEST: {TEMP}'
user7172
  • 754
  • 4
  • 15
  • 30

1 Answers1

3

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

>>> 'TEST{0}: {{TEMP}}'.format("_TEST")
'TEST_TEST: {TEMP}'
Anand S Kumar
  • 82,977
  • 18
  • 174
  • 164