data = [ { "Monday": [{ "08:00": "Test", "09:00": "Test", "10:00": "Test", "11:00": "Test", }], }, { "Tuesday": [{ "08:00": "Test", "09:00": "Test", "10:00": "Test", "11:00": "Test", }], } ] for obj in data: print("当前对象", obj.keys()) for week in list(obj.keys()): print(obj[week]) for time in obj[week]: print(time.keys()) print(time.values()) # 输出 当前对象 dict_keys(['Monday']) [{'08:00': 'Test', '09:00': 'Test', '10:00': 'Test', '11:00': 'Test'}] dict_keys(['08:00', '09:00', '10:00', '11:00']) dict_values(['Test', 'Test', 'Test', 'Test'])
当前对象 dict_keys(['Tuesday']) [{'08:00': 'Test', '09:00': 'Test', '10:00': 'Test', '11:00': 'Test'}] dict_keys(['08:00', '09:00', '10:00', '11:00']) dict_values(['Test', 'Test', 'Test', 'Test'])