I have a dictionary as:
default = {\'a\': [\'alpha\'], \'b\': [\'beta\',\'gamma\'], \'g\': []}
I wish to eliminate the empty values as:
Michael's answer is correct.
Stepping back, you might be able to avoid creating those empty lists at all, by use of collections.defaultdict(list)
>>> import collections
>>> d = collections.defaultdict(list)
>>> d
defaultdict(, {})
>>> d["hobbits"].append("Frodo")
>>> d["hobbits"].append("Sam")
>>> d
defaultdict(, {'hobbits': ['Frodo', 'Sam']})