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']
隨后更新.....