我有一个班级和一个n*n
表。我想为表的任何字段创建具有不同名称的对象。例如objects11
,objects12
,objects31
取决于表格的x,y
。我怎么能这样做?
class Variables():
def __init__(self,earn,cost,able,x,y,analogy):
self.earn = earn
self.cost = cost
self.able = able
self.x = x
self.y = y
self.analogy = analogy