python中def和return是必须使用的保留字吗_Python 保留字和关键字的用法
Python 保留字和關(guān)鍵字的用法 詳解
學(xué)習(xí)python3的一些總結(jié)
Python3文檔中詳細(xì)介紹: https://docs.python.org/3/reference/lexical_analysis.html#keywords
概念:保留字是python語(yǔ)言預(yù)先保留的標(biāo)識(shí)符,在程序中有特定用途,不能用來(lái)作為變量名,函數(shù)名使用;保留字大小寫敏感,除開 False,True,None
python獲取關(guān)鍵字列表
import keyword
print(keyword.kwlist)
--- Python 3.6 Console Output ---
['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', 'y
總結(jié)
以上是生活随笔為你收集整理的python中def和return是必须使用的保留字吗_Python 保留字和关键字的用法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 储蓄卡和信用卡的区别
- 下一篇: 传递函数_使用python计算麦克风阵列