Question: Im trying to concatenate a dynamic insert statement ( over 100 inserts ) and instead executing one by one, i want to concatenate all of the statements into only one variable.

Following, a basic exemple:

```
insert_ = " insert into table ( field,zone) values ('a','b'); "
insert_b = " insert into table ( field,zone) values ('c','d'); "
insert_c = " insert into table ( field,zone) values ('e','f'); "

list = []
list.append(insert_)
list.append(insert_b)
list.append(insert_c)
print list

```

Current output:

```
[" insert into table ( field,zone) values ('a','b'); ", " insert into table ( field,zone) values ('c','d'); ", " insert into table ( field,zone) values ('e','f'); "]

```

Desired output:

```
insert into table ( field,zone) values ('a','b'); insert into table ( field,zone) values ('c','d');  insert into table ( field,zone) values ('e','f');

```

Thanks for reading.

Answer: 
```
c = db.cursor()
values_to_insert = [("a","b"),("c","d"),...]
c.execute_many("INSERT INTO table (val1,val2) VALUES (?,?)",values_to_insert  )

```

this is what execute\_many is for ...
Simple as `"".join(list)` . Or don't use a list at all and just use string concatenation, as Hemesh said.

Also, please don't name your list "list". It's a reserved keyword in python (I sometimes fall into this trap myself, but it's a really bad idea).