Dear group, 

I have two lists:

>>> a
['apple', 'boy', 'boy', 'apple']

>>> b
['Apple', 'BOY', 'APPLE-231']

>>> for i in a:
        pat = re.compile(i,re.IGNORECASE)
        for m in b:
                if pat.match(m):
                        print m

                        
Apple
APPLE-231
BOY
BOY
Apple
APPLE-231
>>> 




Here I tried to match element in list a to element in
list b
and asked to ignore the case.  It did work.

However, I do not know how to make it print only m

What I want :

Apple
BOY
APPLE-231


I do not want python to print both elenents from lists
a and b. 
I just want only the elements in the list B.

how can i do that.. 

Please help me. thank you.


srini


                
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to