>>> d = {'ric':24, 'ric1':46, 'ric2':23, 'mike':1, 'mike1':47}
>>> l = ['ric', 'mike']
>>> for name in l:
... if name in d:
... print '{0} has a value of {1}'.format(name, d[name])
...
ric has a value of 24
mike has a value of 1
snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294