> Although dictionary is superfast, due to duplications
> in both columns of list_a, a dictionary option falls
> out.
Hi Srinivas,
A dictionary method can work perfectly well.
The assumption that I think is being made is that dictionary values are
restricted to single values. But dictionaries are more general than this.
We can make dictionaries that map from strings to lists of things.
For example:
#######
sample = { 'a': ['alphabet', 'artichoke', 'antelope'],
'b': ['beta', 'brocolli', 'brontosaurus'],
'g': ['gamma', 'grub', 'gnome'] }
#######
is a perfectly good dictionary.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor