I will go in the order like this.
First of all, you don't have to remember. When I use it, I get an error saying "invalid syntax". However, isn't there any loss even if you look at it once?
If you execute the following code, it will be listed as a list type.
test.py
import keyword
keyword.kwlist
If you execute the following code, the value will be returned as Boolean type. Please note that ** True cannot be used **.
import keyword
keyword.iskeyword('def') #True
keyword.iskeyword('bag') #False
It's a simple memo, but is it important except for large system development? ??
Recommended Posts