PYTHON LIB

来源:互联网 发布:遇到网络诈骗怎么做 编辑:程序博客网 时间:2024/05/21 23:59

1、all(iterable)

all主要是用来遍历序列中的每个元素。它返回bool

例子

>>> L=[['a','b','c','d'],['1','2','3']]
>>> while all(L):
    print(tuple(s.pop(0) for s in L))


2、locals()

3、exit()

quit()

license
credits

4、python中的常量

True False NotImplemented

Ellipsis __debug__


5、TpyeError

当参与操作运算的数,类型不同时,报错。



6、python container

python容器:

不可变;

tuple

string

unicode

frozenset


可变:

list

dictionary

set

 

7、

s.count(i)

s[i:j:k] 从i到j k为间隔


8、s.index(i)返回i在s中第一次出现的位置


9、print

原创粉丝点击