摘要: >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Compl 阅读全文
posted @ 2018-01-15 15:52 Fate0729 阅读(724) 评论(0) 推荐(1) 编辑
摘要: 1. 字典 d = {"name":"zhangsan", "age":18} dict的键必须是唯一的,但值则不必,键必须是不可边的,如字符串,数组或元祖。 2. dict函数 可以使用dict函数,通过其他映射(比如其他字典)或者(键,值)对的序列建立字典 3. 基本字典操作 字典的基本行为在很 阅读全文
posted @ 2018-01-15 15:48 Fate0729 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 在python中有六种内建的序列:列表、元祖、字符串、Unicode字符串、buffer对象he xrange对象。 通用序列操作: 1. 索引(indexing) 2. 分片(slicing) 3. 加(adding) 4. 乘(multiplying) 5. 检查某个元素是否属于这序列的inde 阅读全文
posted @ 2018-01-15 14:02 Fate0729 阅读(212) 评论(1) 推荐(0) 编辑
摘要: 在python中有六种内建的序列:列表、元祖、字符串、Unicode字符串、buffer对象和 xrange对象。 通用序列操作: 1. 索引(indexing) 2. 分片(slicing) 3. 加(adding) 4. 乘(multiplying) 5. 检查某个元素是否属于这序列的index 阅读全文
posted @ 2018-01-15 13:36 Fate0729 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 从编码和常用字符串函数两方面进行总结 1. 编码 计算机里面,编码方法有很多种,英文的一般用ascii,而中文有unicode,utf-8,gbk,utf-16等等。 unicode是 utf-8,gbk,utf-16这些的父编码,这些子编码都能转换成unicode编码,然后转化成子编码,例如utf 阅读全文
posted @ 2018-01-15 12:43 Fate0729 阅读(325) 评论(0) 推荐(0) 编辑