【Python 数据结构】 微复杂数据结构的渲染
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'])
Python全栈(后端、数据分析、脚本、爬虫、EXE客户端) / 前端(WEB,移动,H5) / Linux / SpringBoot / 机器学习