Missing keywords
Date: January 2nd 2016
Last updated: January 4th 2016
So, if I don't use del, what other key words am I not thinking about. There are 30 python keywords. In no particular order and without cheating, here are the ones I know...
| Keywords | |||||
|---|---|---|---|---|---|
| del | class | import | or | ||
| for | return | def | is | if | |
| in | str | while | and | else | |
| elif |
17...
Here are the ones I missed or dont know...
| Keywords | ||||
|---|---|---|---|---|
| assert | except | pass | not | yield |
| break | finally | exec | raise | |
| continue | global | lambda | try |
13 more, with three I don't know.
EDIT (3/1/16):
The list provided above was taken from Python for Data Analysis by Wes McKinney. The list of keywords given for python 3 in Python programming: an introduction to computer science by John Zelle is slightly different. The list of keywords has 34 entries, omitting several from the py27 list: exec and print. The new entries include:
| Keywords | ||||
|---|---|---|---|---|
| None | False | True | nonlocal | from |
EDIT (4/1/16):
Use the following code to find keywords available on your system
import keyword
keyword.kwlist
# ['and','as','assert','break','class','continue','def','del',
# 'elif', 'else','except','exec','finally','for','from','global',
# 'if','import','in','is','lambda','not','or','pass','print',
# 'raise','return','try','while','with','yield']