【干货】Python遍历输出字典中的键值对 题目解法1. for循环 + d[i]2. for循环 + d.items() 题目 利用循环,遍历输出字典中的键值对 解法 1. for循环 + d[i] dic = {'name':'jyw', 'lang':'python', 'age':'21'} for i in dic: print(i,dic[i]) 2. for循环 + d.items() dic = {'name':'jyw', 'lang':'python', 'age':'21'} for k,v in dic.items(): print(k,v)