[Tutor] Comparing lists

Terje Johan Abrahamsen terjeja@hotmail.com
Tue, 09 Jul 2002 14:36:02 +0000


I have two lists of different length. Actually each list can differ in 
lenght every time. For example lista = [12, 34, 56] & listb = [14, 16, 34, 
81]. What I now need to do is to check if the lists have one or more common 
numbers. In this case 34 exists in each list. Then I would like the function 
to somehow indicate this. Does it exist a simple way to do this? I have made 
a somehow functioning function that does this, but it is probably about 
50-60 lines. (If lista[0] == listb[0], if lista[1] == listb[0] and so 
forth....)

Any suggestions?

Thanks,
Terje



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com