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