How to avoid Multi-layer Loop nesting in python

Hello, everyone. I recently wrote a script because a lot of the information in the middle is stored in multiple dictionaries and there are nested dictionaries. As a result, when I take relevant information later, I have to use multiple for nesting, which leads to poor readability of the code, so I would like to ask you how to avoid multiple loop nesting. For example,

for key, values in XXX.items():
    for apple, banana in values.items():
        for cats, dogs in YYY.items():
            ...
Mar.11,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32da7-2b394.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32da7-2b394.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?