Luis and all,
I want to more than matching, I am trying to find all the available combos,
e.g a1 == x1 or a1 == x2 or a1 != x1.
HTH,
Nathan Pinno
I also noticed you forgot the a[1] == b[1]. (grin) :)
----- Original Message -----
Sent: Wednesday, July 27, 2005 3:01
PM
Subject: Re: [Tutor] How do I go about
this?
On 7/27/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
Hi all,
How do I go about the following: I want to write a program that will
print two lists one after another, then show all the available possibilities
for matches e.g a0 and x0.
Here is what I have so far:
lista = [x0, x1, x2, x3] listb = [a0, a1, a2, a3] print
lista print listb
Thanks for the help,
Nathan Pinno
Hi,
Could you give some additional information as to what
you intend to do? If you are strictly matching, by position within the lists,
such that you would print the list elements only if:
for x in
range(min(len(lista),len(listb))): a =
lista[x] b = listb[x] if a ==
b: print a, b
that is
easy, however, if you want to match more complex patterns, or wish to match
list elements not in the same position then the complexity of the task
increases.
_______________________________________________ Tutor maillist
-
Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
|