Do you want the list of Python Keywords that used in writing Python code which will help you to increase your Python programming skills?
Then you land at the right place.
We have gathered all of the Python Keywords (Words) & Special Identifiers that commonly used and are only reserved for Python interpreter.
You must not use these words as variable names.
Let’s look at those list:
Note: All are in lowercase.
There are a large number of built-in names that you must not use, except for their intended purpose. The cases of True, False, and None are important.
The most common ones are listed here:
To see a list of these built-ins, list the contents of the __builtins__ module in the shell like this:
Python Special Identifiers
Python also provides some special identifiers that use underscores. Their name will be of the form:
_xxx __xxx__ __xxx
Read also: Check Python Version in macOS
Mostly, you can ignore these. However, one that you might encounter in your programming is the special system variable:
This variable specifies how the module was called. __name__ contains:
- The name of the module if imported.
- The string ‘__main__‘ if executed directly.
You often see the following code at the bottom of modules. The interpreter loads your program and runs it if necessary.
if __name__ == '__main__': main()
Let us know if you have any questions or have an opinion about this post in the comment box.
Don’t forget to share this Python Words & Special Identifiers.