python3.x中的33个保留字

 

1 Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
2 [GCC 8.3.0] on linux
3 Type "help", "copyright", "credits" or "license" for more information.
4 >>> import keyword
5 >>> keyword.kwlist
6 ['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']

Python3.7以后又增加了两个关键字:async和await,现在总共35个关键字。

1 Python 3.7.3 (default, Apr  3 2019, 19:16:38) 
2 [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
3 Type "help", "copyright", "credits" or "license" for more information.
4 >>> import keyword
5 >>> keyword.kwlist
6 ['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', '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']

随后更新.....

 

posted @ 2018-10-09 09:09  丹华抱一鷇音子  阅读(2587)  评论(0编辑  收藏  举报