Python 学习 转载(出处:http://www.cnblogs.com/vamei )加心得 3days

摘要: class Human(object): laugh = 'hahahaha' def show_laugh(self): print self.laugh def laugh_100th(self): for i in range(100): self.show_laugh()//也可以调用 sh 阅读全文
posted @ 2016-12-11 00:16 chaoren_chen 阅读(104) 评论(0) 推荐(0)

Python 随便 2days

摘要: if以四个空格的缩进来表示隶属关系, Python中不能随意缩进 函数调用和参数传递 定义过函数后,就可以在后面程序中使用这一函数 Python通过位置,知道3对应的是函数定义中的第一个参数a, 4对应第二个参数b,然后把参数传递给函数square_sum。 (Python有丰富的参数传递方式,还有 阅读全文
posted @ 2016-12-09 23:22 chaoren_chen 阅读(165) 评论(0) 推荐(0)

Python 学习 转载(出处:http://www.cnblogs.com/vamei )加心得 1天

摘要: a=10 # int 整数 a=1.3 # float 浮点数 a=True # 真值 (True/False)//不能小写 a='Hello!' # 字符串。字符串也可以用双引号。 以上是最常用的数据类型。此外还有分数,字符,复数等其他类型。 sequence(序列)是一组有顺序的元素的集合 (严 阅读全文
posted @ 2016-12-08 23:27 chaoren_chen 阅读(229) 评论(0) 推荐(0)