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']

随后更新.....

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM