0

I just want the following outcome. But I get KeyError: '"msg_body"'.

input:

text="text"
uid="uid"
input = '{"msg_body":{input_text}, "user_id":{input_uid}}'.format(input_text=text, input_uid=test)

wanted output:

'{"msg_body":"text", "user_id":"uid"}'

Single or double quotations must be exactly how it is above. Thanks

2
  • 2
    Double the outermost braces Commented Jun 4, 2019 at 5:24
  • thanks and sorry for asking a duplicated question. Commented Jun 4, 2019 at 8:35

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.