【发布时间】:2022-01-24 18:04:00
【问题描述】:
我有两本字典
D1 = {('one', 'two'): 3, ('three', 'four'): 5, ('five', 'six'): 7, ('eight', 'nigh'):8}
D2 = {'one':1, 'five': 2}
我想删除 D1 中的 ('one', 'two'): 3 和 ('five', 'six'): 7,因为 D2 包含“一”和“五”。
【问题讨论】:
-
你尝试过什么,它到底有什么问题?
标签: python dictionary