[Tutor] omit some keys from dict

Karthik Gurumurthy karthikg@aztec.soft.net
Wed, 16 Jan 2002 00:25:25 +0530


I have a dict and i don't want to look for certain keys.
"omit" lists the keys i want to omit.
To get the remaining keys i can probably do this..


j= {1:'hello',2:'fine',3:'python',4:'dicts',5:'lists',6:'tuples'} #actual
dict
omit = [1,3,5]
checkkeys = [key for key in j.keys() if key not in omit]

Now how can i write this using *only* filter and lambda?

I thought i w'd'nt use list comprehensions, but now for this problem
i had to use LCs.

thanks,
karthik.