True | break | finally | is | return |
False | continue | for | lambda | try |
None | except | in | raise | pass |
class | def | from | nonlocal | while |
and | del | global | not | with |
as | elif | if | or | |
assert | else | import | yield |
keyword.iskeyword(s)
Return true if s is a Python keyword.
keyword.kwlist
Sequence containing all the keywords defined for the interpreter. If any keywords are defined to only be active when particular __future__
statements are in effect, these will be included as well.
Python Identifier are the names given to the fundamental building blocks in a program. Like class, object, variables, functions, lists, dictionaries etc. in Python. It helps differentiating one entity from another.
1. Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9).
2. No special character except underscore ( _ ) can be used as an identifier.
3. We cannot use special symbols like !, @, #, $, % etc. in our identifier.
4. Keyword should not be used as an identifier name.
5. Python is a case-sensitive language. This means, Variable and variable are not the same. Always name identifiers that make sense.
6. First character of an identifier can be character, underscore ( _ ) but not digit.
7. Multiple words can be separated using an underscore ( this_is_free_time_learning ).