Last week we talked to you about Predefined functions in Python, if you have not read it yet, we invite you to do so. Also, if you want to learn more about this fascinating language, we invite you to stop by our master in Advanced Programming in Python for Big Data, Hacking and Machine Learning.
This week we are going to teach you nothing more and nothing less than 36 keywords that cannot be used as names of variables, functions or any other type of identifier anymore which are reserved words.
List of reserved words
To begin with, if we want to see the list of reserved words, Depending on the version of Python we use, We start by putting the help() command in the console to access the help:

In our case we use version 3.9. Once inside the help, We type keywords to see the list:

Reserved words in Python and their meaning
Next, let's quickly see what each of the reserved words more explicitly.
- False – Boolean value, result of comparison operations or logical operations in Python
- None – Represents a null value
- true – Boolean value, same as false, result of comparison operations or logical operations in Python
- __peg_parser__ – Called Easter egg, related to the launch of the new peg analyzer It is not defined yet.
- And – Logical operator
- Ace – Used to create an alias when importing a module.
- Assert – Used for debugging purposes
- Async – Provided by the 'asyncio' library in Python. Used to write concurrent code in Python
- Await – Provided by the 'asyncio' library in Python. Used to write concurrent code in Python
- break – Used inside for and while loops to alter their normal behavior
- class – Used to define a new user-defined class
- Continue – Used inside for and while loops to alter their normal behavior
- Def – used to define a user-defined function
- Of the – To delete an object
- Elif – Used in conditional statements, equal to 'else' and 'if'
- Else – Used in conditional statements, same as 'elif' and 'if'
- Except – Used to create exceptions, what to do when an exception occurs, same as 'raise' and 'try'
- Finally – Its use ensures that the code block within it is executed even if there is an unhandled exception
- For – Used to make loops. We generally use it when we know the number of times we want that loop to execute
- desde – To import specific parts of a module
- Global – To declare a global variable.
- If – Used in conditional statements, same as 'else' and 'elif'
- Import – To import a module
- in – To check if a value is present in a list, tuple, etc. Returns True if the value is present, otherwise returns False
- Es – Used to test if the two variables refer to the same object. Returns True if the objects are identical and False otherwise
- Lambda – To create an anonymous function
- Nonlocal – To declare a non-local variable
- Not – Logical operator
- Or – Logical operator
- Pass – It is a null statement in Python. Nothing happens when it runs. Used as a placeholder.
- Raise – Used to create exceptions, what to do when an exception occurs, same as 'except and 'try'
- return – Used inside a function to exit and return a value.
- try – Used to create exceptions, what to do when an exception occurs, same as 'raise' and 'except
- While – Used to make loops.
- With – Used to simplify exception handling
- Yield – Used inside a function just like 'return', except that 'yield' returns a generator.
Did you know all the Python Keywords or have we taught you some?
I want to learn more about computing, everything that has to do with programming.