Since Python\'s string
can\'t be changed, I was wondering how to concatenate a string more efficiently?
I can write like it:
s += string
my use case was slight different. I had to construct a query where more then 20 fields were dynamic. I followed this approach of using format method
query = "insert into {0}({1},{2},{3}) values({4}, {5}, {6})"
query.format('users','name','age','dna','suzan',1010,'nda')
this was comparatively simpler for me instead of using + or other ways