sh_12_字典的遍历
sh_12_字典的遍历
xiaoming_dict = {"name": "小明", "qq": "123456", "phone": "10086"} # 迭代遍历字典 # 变量k是每一次循环中,获取到的键值对的key for k in xiaoming_dict: print("%s - %s" % (k, xiaoming_dict[k]))
sh_12_字典的遍历
xiaoming_dict = {"name": "小明", "qq": "123456", "phone": "10086"} # 迭代遍历字典 # 变量k是每一次循环中,获取到的键值对的key for k in xiaoming_dict: print("%s - %s" % (k, xiaoming_dict[k]))