2016年3月31日

Python学习笔记#函数中使用文档,让你的函数更容易理解

摘要: >>> def intadd(a,b): 'this is a test of the doc of function' return a+b >>> intadd(2,3) 5 >>> intadd.__doc__ 'this is a test of the doc of function' >>> 阅读全文

posted @ 2016-03-31 22:20 Lirh_china 阅读(200) 评论(0) 推荐(0) 编辑

Python学习笔记#定义函数

摘要: 注意: 不要忘记冒号 注意格式要对齐; 阅读全文

posted @ 2016-03-31 22:15 Lirh_china 阅读(143) 评论(0) 推荐(0) 编辑

Python学习笔记#一些简单函数

摘要: len sum Enumerate zip 阅读全文

posted @ 2016-03-31 22:09 Lirh_china 阅读(154) 评论(0) 推荐(0) 编辑

Python学习笔记#元组和列表的区别

摘要: python的基本类型中有元组和列表这么俩个,但是这哥俩却比较难于区分,今天就来用简单的实例说明两者的不同。 列表:1.使用中括号([ ])包裹,元素值和个数可变 实例: aaa = ['sitename','www','pythontab','com'] 元组:1.使用中括号(())包裹,不可以被 阅读全文

posted @ 2016-03-31 21:57 Lirh_china 阅读(196) 评论(0) 推荐(0) 编辑

Python学习笔记#列表操作常用的函数

摘要: 列表操作常用的两类函数: 1. 添加元素: append extend insert append主要是在列表的尾部添加一个元素: 将得到: extend主要是在列表的尾部添加一些元素,这些元素只能用列表的形式添加: 错误实例: 正确实例: insert函数是指定一个位置插入一个元素;(注意:位置的 阅读全文

posted @ 2016-03-31 21:46 Lirh_china 阅读(211) 评论(0) 推荐(0) 编辑

导航