Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # dict_remove_keys_with_empty_values.py
- d = {1:'',2:None,3:'',4:'a',5:'b',6:'',7:'c',8:'',9:0,10:''}
- data = {k: v for k, v in d.items() if v!='' and v!=None}
- print data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement