I've got the beginner's version of a question I think Denis asked
recently...

If I'm iterating a variable through a series of list names, for future
processing, I would like to print the name of the list the variable is set
to in a given moment... i.e.

for i in [alist, blist, clist]
    i[3] = "okey dokey "
    print(i[3], i.name)  # this is definitely not the way to do it...

output:
okey dokey alist
okey dokey blist
okey dokey clist

Is there any way to do that? I'm thinking there may not be, since the
variable is actually bound to the content of the list, not the other
name... which would be good, in the sense that I'm beginning to understand,
but bad in the sense that I need to rethink a piece (or two) of code.
-- 
Keith
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to