保留字:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
In [ 4 ]: import keyword
In [ 5 ]: keyword.kwlist
Out[ 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:
1
2
3
4
5
6
7
8
9
|
abs
abstractmethod
all
and
any
apply
as
ascii (python3新增)
assert
|
B:
1
2
3
4
5
6
7
8
|
basestring (python3已删除)
bin
bool
break
buffer (python3已删除)
bytearray
bytes
|
C:
1
2
3
4
5
|
callable
class
classmethod
compile
complex
|
D:
1
2
3
4
5
6
|
def
del
delattr
dict
dir
divmod
|
E:
1
2
3
4
5
6
|
elif
else
eval
except
exec
execfile (python3 删除)
|
F:
1
2
3
4
5
6
7
|
filter
finally
float
for
format
from
frozenset
|
G:
1
2
3
|
getattr
global
globals
|
H:
1
2
3
4
|
hasattr
hash
help
hex
|
I:
1
2
3
4
5
6
7
8
9
10
|
id
if
import
in
input
int
is
isinstance
isubclass
iter
|
L:
1
2
3
4
|
lambda
len
list
locals
|
M:
1
2
3
4
|
map
max
memoryview
min
|
N:
1
2
3
|
next
nonlocal (python3新增)
not
|
O:
1
2
3
4
5
|
object
oct
open
or
ord
|
P:
1
2
3
4
|
pass
pow
print
property
|
R:
1
2
3
4
5
6
7
|
raise
range
repr
return
reload
reversed
round
|
S:
1
2
3
4
5
6
7
|
set
setattr
slice
sorted
str
sum
super
|
T:
1
2
3
|
try
tuple
typle
|
V:
1
|
vars
|
W:
1
2
|
while
with
|
X:
1
|
xrange (python3 已删除)
|
Y:
1
|
yield
|
Z:
1
|
zip
|
欢迎补充~
以上这篇对Python 内建函数和保留字详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/xiaodongxiexie/article/details/77336966