I want to operate a local list in a class in Python. I can not do that:
However, global list is possible.
Code:
class cCompetition:
lcPersonAll = []
def AddPerson(self, cPersonNew):
lcPersonAll.append(cPersonNew)
cCompetition1 = cCompetition()
cCompetition1.AddPerson("Smith")
Comment