《笨办法学 Python》 学习笔记05 —— Class
2011-10-15 20:41
337 查看
Class
class TheThing(object): def __init__(self): self.number = 0 def some_function(self): print "I got called." def add_me_up(self, more): self.number += more return self.number # two different things a = TheThing() b = TheThing() a.some_function() b.some_function() print a.add_me_up(20) print b.add_me_up(30) print a.number print b.number
相关文章推荐
- “笨办法学python”学习笔记-一些附加题
- 《笨办法学 Python》 学习笔记02
- Google Python Class 学习笔记(1) Introduce String list del
- 《笨办法学 Python》 学习笔记03 —— Function、List、Dist
- 笨办法学Python学习笔记 练习21
- 笨办法学Python学习笔记 练习26
- Python学习笔记:类(class)
- Python 学习笔记:class
- 编程小白的第一本 python 入门书 学习笔记05 第六章 数据结构
- “笨办法学python”学习笔记-在终端powershell中对目录进行简单的编辑(一)
- python学习笔记(05)
- python学习笔记05(字符串与list)
- python学习笔记 class
- Google Python Class 学习笔记(2) 正则表达式
- 05-python学习笔记:切片
- Python学习笔记 --- 'password' is an invalid keyword argument for this function解决办法
- “笨办法学python”学习笔记-错误整理
- python学习笔记30(全局变量的两种解决办法)
- win7下不能使用dnw烧写的解决办法——韦东山嵌入式Linux学习笔记05
- 笨办法学Python学习笔记 练习32