class Person(object): def _init_(self,name,gender,birth,**kw): self.name=name self.gender=gender self.birth=birth for k,v in kw.iteritems(): setattr(self,k,v)xiaoming=Person('Xiao Ming','Male','1992-1-1',job='student')print (xiaoming.name)print (xiaoming.job)
添加回答
举报
0/150
提交
取消