On Tue, Jul 1, 2008 at 3:09 AM, Norman Khine <[EMAIL PROTECTED]> wrote:
> x = getattr(brain, horizontal)
> if isinstance(x, list):
> for item in x:
> x = item
This just assigns x to the last element of the list, it doesn't
process the whole list. One possibility would be to ensure that x and
y are always lists, then use nested loops to iterate over all
combinations:
x = getattr(brain, horizontal)
if not isinstance(x, list):
x = [x]
y = getattr(brain, vertical)
if not isinstance(y, list):
y = [y]
for first in x:
for second in y:
if first and second and (first, second) in table:
etc.
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor