I am generating these 2 lists using list comprehension.
lists = ['month_list', 'year_list']
for values in lists:
print [<list comprehension computation>]
>>> ['2012', '2011', '2010', '2009', '2008', '2007', '2006', '2005', '2004', '2003']
>>> ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
I want to append these 2 dynamically generated lists to this list names.
for example :
month_list = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
year_list = ['2012', '2011', '2010', '2009', '2008', '2007', '2006', '2005', '2004', '2003']
Sounds to me like you should be using references instead of names.
But list comprehensions can only create a single list regardless, so you'll need to rethink your problem.
Why use strings in the first place?
Why not just do...
after you define the two lists?
You can add global variables to the modul's namespace and connect values to them with this method:
Read more about namespaces in Python documents.
Or you can store these list in a new dictionary.