【发布时间】:2021-09-20 13:16:37
【问题描述】:
我有一个字典,我想在其中删除名称以 S 开头的键,即“person_3”。
My_Dict = {
"person_1": {"name": 'John', "age": 22, "Interests": ['football","cricket'],
"amount_deposited": [24000, 26000]},
"person_2": {"name": 'Nancy James', "age": 23, "Interests": ['baseball’,’cricket'],
"amount_deposited": [24000, 27000]},
"person_3": {"name": 'Selena Gomez', 'age': 26, "Interests": ['baseball', 'table tennis'],
"amount_deposited": [24000, 28000]}
}
【问题讨论】:
标签: python dictionary functional-programming