Advertisement
here2share

# in_dict.py

Sep 1st, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. # in_dict.py
  2.  
  3. di = {'1':'hello','2':'have','3':'a','4':"nice day"}
  4. li = [4,1,3]
  5.  
  6. res = {`i`:di[`i`] for i in li}
  7.  
  8. print res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement