-1
的
考虑两个字典:创建新的字典了两个现有的字典
dict1 = {'a': 35, 'b': 39, 'c': 20} # (with the values as integers)
dict2 = {'a': 23, 'c': 12}
我想获取以下信息:
dict_new = {'a': 0.657, 'c': 0.6} # (with the values as floats, as values of dict2/dict1)
那么你尝试过什么,以及究竟是它的问题? “b”和“dict2”中不在“dict1”中的按键有什么关系? – jonrsharpe