Python String concatenation with in double quotes [closed]

That isn’t a concatenation: you’re not appending this to anything else. It’s only a value substitution. Thus, you should (1) use the variable name, rather than a string; (2) leave out the concatenation attempt.

     "device-id": d1,

This should substitute the desired value of varibale d1.

Leave a Comment