'exit' is not a keyword in Python, but no error occurs while using it
据了解,
1 2 | import keyword print('exit' in keyword.kwlist) # Output: False |
但在使用时,并没有提到
1 2 3 4 5 6 7 8 9 10 11 12 | for i in range(5): print(i) cur=i if i<2 else exit print(cur) # Output 0 1 2 3 4 Use exit() or Ctrl-D (i.e. EOF) to exit |
号
我无法从python文档中获得关于
关键词是Python语法的一部分。他们通常在声明中有特别的含义(E.G.
Builtins are callable objects(e.g.functions or at least function-like)that python provides in the namspace by default.建筑物功能的实例与
在交互式会议上提供了一个很好的机会。It's highly encouraged to use
是
是一个由
The
site module (which is imported automatically during startup,
except if the-S command-line option is given) adds several constants
to the built-in namespace. They are useful for the interactive
interpreter shell and should not be used in programs.
当你使用交互式控制器时,是
有很多东西存在,但它们不是关键词(E.G.EDOCX1&10),EDOCX1&11…)。所以你可以连接到存在的名字,而不是关键词