上一页 1 ··· 8 9 10 11 12
摘要: set有点:1、访问速度快 2、天生解决了重复问题 tuple与set区别: 元组可重复,set不可重复创捷集合1 >>> s1.add('alex')>>> print(s1){'alex'}>>> s1.add('alex')>>> print(s1) {'alex'} 创建集合2>>> set 阅读全文
posted @ 2016-02-01 22:26 tec2019 阅读(141) 评论(0) 推荐(0)
摘要: 字符编码 编程规范(PEP8) 变量1.常量(用大写) 2.变量 常用类型:str 、int、float、 long、bool 字串格式化: %d 整数 %2d占两位 %02d占两位用0填充%f 浮点数%.2f取两位小数%s字符串%x十六进制整数%%表示 %#单行注解'''多行注解 >>>n = " 阅读全文
posted @ 2016-01-23 08:34 tec2019 阅读(171) 评论(0) 推荐(0)
摘要: python2.x版本与3.x版本的语法差异1、python 3.x print 输出的语加必须加上() e.g print"hello world" 在3.x版本变为了print("hello world")2、python2.x版本里的raw_input 在3.x里变为了input。即 3.x版... 阅读全文
posted @ 2016-01-18 19:07 tec2019 阅读(142) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12