All the Keywords in Python!

Updated 16 February 2022

Welcome to the next step of understanding in your programming escapades with Python. This guide will introduce an overview of all keywords within Python, provide an understanding of what exactly a keyword is and how to make simple codes with them. The programming language of Python has a set of keywords. These are reserved words that make up the syntax and vocabulary of programming languages. These keywords often are referred to as reserved names. Keywords cannot be used as identifiers for variables, cannot be used for function names and cannot be used as any kind of identifier. Numerous keywords have great depth to them when utilised in code, such as those associated with loop structures, and this will be investigated in further tutorials. Loop structures allow you to run one or more lines of code repetitively. This guide will also enlighten you about the Help Utility which is built directly into Python.

By having a firm grasp of the scope of possibilities that keywords bring to the table you will be better equipped in your daring voyages through the Python programming landscape. This guide will clarify every keyword type and outline how they can be useful in your coding missions. Contents of this guide can be seen below.

There are several related tutorials on our website to help you become a true Pythonista. A great place to start this process would be Python Rundown and Main Windows. This will also tell you where to download Python and access online Python emulators. Python is an excellent language to utilise with Raspberry Pi Boards such as Raspberry Pi 4 Model B 8GB. These are computing devices that can easily fit on the palm of your hand.

If you have any questions, queries or things to add please let us know your thoughts!


Overview of Python KeywordsKey made of Words

Keywords are the nuts and bolts vocabulary of the Python programming language. They serve as fundamental building blocks and tools for communication between you and your computing device. They form the syntax and structure of a Python software program. A keyword is a combination of letters, usually forming a word, that has a special meaning. This special meaning can be commands or parameters which will be executed as soon as the computing device encounters the keyword when the code is run. This is the reason keywords are reserved by programming languages. Reserved means they cannot be used in defining variables, classes or functions. Keywords in Python are also case sensitive.


All Keywords in Python Tabulated

Below are all the keywords in Python tabulated with explanatory text and sample code attached. Keywords with similar or related effects are organised near each other. They are also loosely organised with a programming beginner in mind, with keywords most likely to encounter or utilise found at the top to the least likely to utilise found at the bottom. A number of these keywords will have tutorial pages all to themselves but for now, it is good simply to be aware of the spectrum. Some keywords would require more elaborate code and comment to effectively demonstrate them and thus the code section has been left empty. Within the table when there is text/symbols that would be written inside a Python IDLE Shell or a Python Program Window (ergo inputted as code) it will be denoted in this tutorial with line symbols, |  |This notation will stay consistent throughout the whole page, please don't type the line symbols into your code as it will cause a syntax error.

All Keywords Within Python UPDATE 


Help Utility in Python

The help function in Python is used to display in-built documentation on keywords, symbols, modules, functions and classes. You can access this in the IDLE shell by directly typing and running | help() |. If you then type directly into the Python Shell the name of the particular keyword, module or topic it will give an in-depth explanation. Below is the shell after the help function is run.

Help Function running


The Next Step

A great next step on your coding adventures would be the guide All the Operators in Python! Precedence too.


Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.