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

demo

#!/usr/bin/python
class 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
上一篇:.NetCore WebApi


下一篇:[leetcode] 题型整理之二叉树