Python学习之类

class Person:

def __init__(self, name):

self.name = name

def sayHi(self):

print('Hello, my name is'+ self.name)


p = Person('Swaroop')

p.sayHi()

posted @ 2015-02-27 15:11  小毛驴  阅读(129)  评论(0编辑  收藏  举报