标签:__init__ 概念 print finish 2.3 obj 必须 new elf
class ren(object):
def __init__(self, name, sex):
self.name = name
self.sex = sex
def hello(self):
print (‘Hello {0}‘.format(self.name))
test = ren("Kelake", "M")
test.hello()
test2 = ren("King", "M")
test2.hello()
标签:__init__ 概念 print finish 2.3 obj 必须 new elf
原文地址:http://www.cnblogs.com/kelake/p/7795539.html