#!usr/bin/python # -*- coding: utf-8 -*- # @Time : 2018/3/14 15:57 # @Author : 黑咖啡 # @Email : webaa88@126.com # @File : dicttest.py # @Software: PyCharm a_dict = { 'haozhe':{'chengji':'100','age':'11'}, 'ruizhe':{'chengji':'300','age':'11'}, 'yanzi':{'chengji':'90','age':'11'}, } print('源字典:',a_dict) for key in list(a_dict.keys()): if a_dict[key]['chengji']=='300': print(key) a_dict.pop(key) print('删除字典中value=300的新字典',a_dict)
浙公网安备 33010602011771号