BASIC vs Python
itsme at yahoo.com
Fri Dec 17 07:48:23 CET 2004
"Adam DePrince" <adam at cognitcorp.com> wrote in message
> Don't do it, unless your goal is simply to embarrass and insult
I saw this code from an earlier post:
lst1 = ["ab", "ac", "ba", "bb", "bc"]
lst2 = ["ac", "ab", "bd", "cb", "bb"]
dct1 = dict.fromkeys(lst1)
print [x for x in lst1 if x not in dct1]
print [x for x in lst1 if x in dct1]
It's simply remarkable for somebody to be able to do it so cleanly (and so
obviously) - "out of the box", if you may.
Sure, you can do it in Basic. Ur...sure? Yes, sure...
> Adam DePrince
More information about the Python-list