# Auther: Aaron Fan info = { ‘stu1102‘: ‘LongZe Luola‘, ‘stu1103‘: ‘XiaoZe Maliya‘, ‘stu1106‘: ‘Alex‘} #方法1(更高效)for key in info: print(key,info[key]) print("-----------------------------------------------")#方法2for k,v in info.items(): #会先把dict转成list,数据里大时莫用 print(k,v)
时间: 2024-11-29 07:04:09