摘要: python2、3的区别输入:python2:raw_input()python3:input()输出:python2:printpython3: print()编码:正对的编码器默认编码方式python2 --asccipython3--utf-8 阅读全文
posted @ 2019-08-22 18:02 joker_you 阅读(146) 评论(0) 推荐(0) 编辑
摘要: range基本用法:range:顾头不顾尾range(10)--返回0-9的数字ey: for i in range(10): print(i) result:0,1,...,9range(0,10)--等同于range(10),返回0-9的数字ey: for i in range(0,10): p 阅读全文
posted @ 2019-08-22 18:00 joker_you 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 对可迭代数据类型进行for遍历取值,str list tuple dict set range在循环过程中不能对list、dict进行删除操作。 阅读全文
posted @ 2019-08-22 17:58 joker_you 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 方法转换:str -->list str.split() list -->str ''.join(list)强制转换:str -->list list(str) str -->tuple tuple(str) str -->set set(str) list -->tuple tuple(list) 阅读全文
posted @ 2019-08-22 17:56 joker_you 阅读(283) 评论(0) 推荐(0) 编辑