Python MemoryError on a small forloop -


i'm having issue small loop. i'm trying create list of columns in excel sheet , use following code:

import string col_list = list(string.ascii_uppercase) in col_list:     = 'a' +     col_list.append(a) print col_list 

i following error:

traceback (most recent call last):     file ".../table.py", line 5, in <module>     = 'a' + memoryerror 

the output want list goes ['a', 'b', 'c', ... , 'ax', 'az']

could please me understand going on here? thank you.

you adding list loop on it, loop never ends. try making copy of list:

for in list(col_list):     = 'a' +     col_list.append(a) 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -