I have a nested list, for example:
nlist = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]
Before inserting this list into the database, I would like to add a “column” to it with the same value in each row of the new column, for example:
nlist = [ [a, 1, 2, 3], [a, 4, 5, 6], [a, 7, 8, 9], ]
What is the best way to do this when, for example, the original nested list can contain hundreds of lines?
source share