Python的关键字是说的是Python自带的,具有特定含义标识符,但为什么type不是关键字呢
关键字作变量会有语法报错的
但是内置函数名,比如 type sum list id 等等,同样也不作变量用,会屏蔽掉函数
>>> for = 1
SyntaxError: invalid syntax
>>> in = 1
SyntaxError: invalid syntax
>>> type(1)
<class 'int'>
>>> type = 10
>>> type(1)
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
type(1)
TypeError: 'int' object is not callable
>>> type
10
type()是函数