daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. small_dict = {"a":"1"}
  3. full_dict = {"a":"1", "b":"test", "c":["junk"]}
  4.  
  5. template = {"a":int, "c":list}
  6.  
  7. def check(incoming_args, template):
  8.     res = {}
  9.     for key in template:
  10.         if key in incoming_args:
  11.             res[key] = template[key](incoming_args[key])
  12.     return res
  13.  
  14. print check(small_dict, template)
  15. print check(full_dict, template)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top