摘要: 1. 函数式编程1. 高阶函数1. map/reduce2. filter3. sorted2. 返回函数3. 匿名函数4. 装饰器5. 偏函数2. 模块1. 使用模块2. 安装第三方模块 1. 函数式编程 1. 高阶函数 变量可以指向函数 >>> f = abs>>> f(-10)10 函数名也是变量 传入函数 def add(x, y, f):return f(x) + f(y)>... 阅读全文
posted @ 2016-06-01 15:46 ldbmcs 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 1. 函数2. 高级特性 1. 函数 调用函数 函数API: http://docs.python.org/3/library/functions.html#abs 数据类型转换 int(),float(),str(),bool()… 定义函数 在Python中,定义函数使用def语句。 def my_abs(x):if x >= 0: return xelse: ret... 阅读全文
posted @ 2016-06-01 15:42 ldbmcs 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.Python安装(环境变量)2. Python解释器(CPython)3. “HELLO WORLD”4. 文本编辑器5. 输入和输出6. Python基础 1.Python安装(环境变量) 2. Python解释器(CPython) 3. “HELLO WORLD” 1. 100+200 2. print("hell,world") 4. 文本编辑器 1. Sublime Te... 阅读全文
posted @ 2016-06-01 15:41 ldbmcs 阅读(343) 评论(0) 推荐(0) 编辑