Python字典的items()方法

    科技2022-07-11  86

    定义:用列表返回可遍历的(键,值)元组数组。 语法:dict.items() 返回值:(键,值)元组数组

    dic_score={"LiGang93":93, "ChenJing78":78, "ZhangJinzhu88":88, "ZhaoQishan91":91, "LiXin65":65, "HuangNing83":83} print(dic_score.items())

    执行后 遍历字典列表

    for key,values in dic_score.items(): print (key)

    Processed: 0.026, SQL: 8