摘要: 原理:是临近的数字两两进行比较,按照从小到大或者从大到小的顺序进行交换,function bubbleClick() { var str = "50,1,4,6,9,76,43,22,2,44,7,66"; bubble(str);}function bubble(str) { v... 阅读全文
posted @ 2015-08-20 20:34 oiliu 阅读(522) 评论(1) 推荐(1) 编辑
摘要: 1、使用 __slots__ 给实例绑定方法,>>> def set_age(self, age): # 定义一个函数作为实例方法... self.age = age...>>>from types import MethodType>>>s.set_age=MethodType(set_a... 阅读全文
posted @ 2015-08-20 14:02 oiliu 阅读(168) 评论(2) 推荐(1) 编辑