首页 > 代码库 > python学习笔记十二:类的定义

python学习笔记十二:类的定义

demo

#!/usr/bin/pythonclass Person:    name = jim    age = 25    def say(self):        print My name is  + self.name + , and age is  + str(self.age)p = Person()p.say()print p.name

 

python学习笔记十二:类的定义