摘要: 1,set访问速度快2,天生解决了重复问题 class set(object): """ set() -> new empty set object set(iterable) -> new set object Build an unordered collection of unique elements. """ def add(s... 阅读全文
posted @ 2018-01-03 10:39 sunice1986 阅读(105) 评论(0) 推荐(0)
摘要: 字符串常用功能: 移除空白 分割 长度 索引 切片 移除空白 Str1 = input("Please input your name:").strip() #移除输入name前后空白部分 Str1 = input("Please input your name:").strip("a") #移除输 阅读全文
posted @ 2017-12-21 12:54 sunice1986 阅读(148) 评论(0) 推荐(0)
摘要: 文件操作:os.mknod("test.txt") 创建空文件fp = open("test.txt",w) 直接打开一个文件,如果文件不存在则创建文件 关于open 模式: w 以写方式打开,a 以追加模式打开 (从 EOF 开始, 必要时创建新文件)r+ 以读写模式打开w+ 以读写模式打开 (参 阅读全文
posted @ 2017-12-20 23:20 sunice1986 阅读(230) 评论(0) 推荐(0)