SyntaxFix
Write A Post
Hire A Developer
Questions
Yet another one (I prefer Mark Longair's answer)
di = {'a':1,'b':2,'c':3} req = ['a','c','w'] dict([i for i in di.iteritems() if i[0] in di and i[0] in req])