我有 a = {'foo': 2, 'bar': 3, 'baz': 5 }
a = {'foo': 2, 'bar': 3, 'baz': 5 }
无论如何我可以进入a = {'foo': 0.2, 'bar': 0.3, 'baz': 0.5 }一条线?需要将每个值除以总值...我只是无法完成它... :(
a = {'foo': 0.2, 'bar': 0.3, 'baz': 0.5 }
非常感谢!
python dictionary
dictionary ×1
python ×1