class People(object): passdef score(self,attr): self.attr=attrPeople.score=score
if __name__ == '__main__': p=People() p.score("11") print(p.attr)方式二: