这篇文章主要介绍python当中用的非常多的一种内置类型——str.它属于python中的Sequnce Type(序列类型).python中一共7种序列类型,分别为str(字符串),unicode(u字符串),list(列表),tuple(元组),bytearray(字节数组),buffer(缓冲内存),xrange(范围).它们的通用操作如下: Operation Result x in s 判断x是否在s中 x not in s 判断x是不在s中 x + t 两个序列合并, 将t加到s之后
2.1 Built-in Functions The Python interpreter has a number of functions built into it that are always available. They are listed here in alphabetical order. __import__( name[, globals[, locals[, fromlist]]]) This function is invoked by the import sta
给出定义: re.sub(pattern, repl, string, count=0, flags=0) Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. If the pattern isn’t found, string is returned unchanged. repl can be
一.python中的特殊数据类型 对于python,一切事物都是对象,对象基于类创建.像是“wangming”,38,[11,12,22]均可以视为对象,并且是根据不同的类生成的对象. 参照:http://www.cnblogs.com/wupeiqi/articles/4911365.html 1.列表 如[12,12,23].['wan','fad','dfjap]等 列表具备的功能: class list(object): """ list() -> new em