什么是有效的方法?
我可能有成千上万的key:value对要添加到现有字典中。 我应该只遍历它们,还是有大量更新选项?
You can use the update functions for add all of the value from another dict your_dict.update(all_value_to_add)
your_dict.update(all_value_to_add)
否则您可以有效地遍历它们
You can use the update functions for add all of the value from another dict
your_dict.update(all_value_to_add)
否则您可以有效地遍历它们