79514458

Date: 2025-03-17 11:41:32
Score: 1
Natty:
Report link
d = {'a': [1], 'b': [1, 2], 'c': [], 'd':[]}

d = {k:v for k,v in d.items() if type(v) == list and len(v)>0}

print(d)

Output:

{'a': [1], 'b': [1, 2]}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: DiamondHeart