Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in_dict.py
- di = {'1':'hello','2':'have','3':'a','4':"nice day"}
- li = [4,1,3]
- res = {`i`:di[`i`] for i in li}
- print res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement