What is the proper way to remove keys from a dictionary with value == None in Python?
None
You can also do this using the del command
f = {}; f['win']=None f => {'win': None} del f['win']
Or if you want this in a function format you could do:
def del_none_keys(dict): for elem in dict.keys(): if dict[elem] == None: del dict[elem]