On Fri, Jan 03, 2014 at 02:45:04AM -0500, Keith Winston wrote:
> And to beat that poor horse in the same example, my current way of doing
> that would be:
> 
> for alist in "lista", "listb":
>     print(alist, eval(alist))

Since you know both pieces, namely the name of the entity "alist" and its 
actual symbol aka alist, why not do something like:

    Lists = {"lista": lista, "listb": lisb}

and use
    Lists[x] ...

HTH

Asokan Pichai

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to