I have a key Soldier
. I have many keys like this, I'm trying to make a dictionary that contains all of the units in a particular video game and associates with those units their various stats, including HP, attack, speed, and so on.
So for example, I want to associate these values to Soldier
:
'115', '4.2', '8', '0', '0', '.35', '.15', '.99'
是否可以将所有这些值与字典中的一个键相关联?如果没有,我应该制作多本字典,每本统计资料一本(例如HP)吗?
如果我了解您要正确执行的操作,
每个士兵都应该列出字典
最好进行OOP并为士兵创建一个类,并将每个统计信息作为属性
之后,您可以保留这些士兵对象的列表