Python 内建函数和保留字

来源:互联网 发布:美国mac气动官网中文版 编辑:程序博客网 时间:2024/06/03 13:40

保留字:

In [4]: import keywordIn [5]: keyword.kwlistOut[5]: ['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

其他可用:
A:

absabstractmethodallandanyapplyasascii  (python3新增)assert

B:

basestring(python3已删除)binboolbreakbuffer(python3已删除)bytearraybytes

C:

callableclassclassmethodcompilecomplex

D:

defdeldelattrdictdirdivmod

E:

elifelseevalexceptexecexecfile(python3 删除)

F:

filterfinallyfloatforformatfromfrozenset

G:

getattrglobalglobals

H:

hasattrhashhelphex

I:

idifimportininputintisisinstanceisubclassiter

L:

lambdalenlistlocals

M:

mapmaxmemoryviewmin

N:

nextnonlocal (python3新增)not

O:

objectoctopenorord

P:

passpowprintproperty

R:

raiserangereprreturnreloadreversedround

S:

setsetattrslicesortedstrsumsuper

T:

trytupletyple

V:

vars

W:

whilewith

X:

xrange (python3 已删除)

Y:

yield

Z:

zip

欢迎补充~

原创粉丝点击