79608200

Date: 2025-05-06 07:41:15
Score: 1
Natty:
Report link

Try using dictionary comprehension. It is clean and easy to read.

new_dict = {
    key: val
    for key, val in my_dict.items()
    if val['category']['name'] == 'Fruit'
}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: JZ Tay