Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Exploring Keywords in Python (Summary)

Python keywords are the fundamental building blocks of any Python program. Understanding their proper use is key to improving your skills and knowledge of Python.

Throughout this video course, you’ve seen a few things to solidify your understanding Python keywords and to help you write more efficient and readable code.

In this video course, you’ve learned about:

  • The Python keywords and their basic usage
  • Several resources to help deepen your understanding of many of the keywords
  • Python’s keyword module for working with keywords in a programmatic way

To take a closer look at keywords, you can check out:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 Congratulations! You made it to the last lesson of this course. I will quickly summarize what you learned and then will give you inspiration about what to do next.

00:12 You started by listing all Python keywords, with the built-in functions keyword() and help(). And then you learned that keywords are special, reserved words.

00:22 They are restrictive in their usage, and they are fundamental building blocks and always available. That means you don’t need to import them into your Python code.

00:34 In lesson three, we categorized the keywords, and you also got a cheat sheet. And this was a quite long lesson, but with the grouping of the keywords and the examples that I provided you, you hopefully got an idea about how you can use them and maybe how you already use those Python keywords.

00:55 So it’s all fine to know keywords theoretically, but sometimes there are situations where you want to identify them in your code. And that’s what you learned in lesson four. Again, you use the built-in keyword() function or the help() function and also leveraged syntax highlighting in your code editor.

01:16 Another way of identifying keywords was just running into syntax errors, and then you know. And last but not least, you learned about deprecated keywords.

01:27 The main takeaway here was that the exec and print statements are now functions. So if you’re wondering what to do next, of course, we at Real Python have you covered. The links that you will see in the next slides are also in the description below, so you can just click them and read on.

01:47 So, one thing that you can do is have a closer look at keywords. Here are five example articles for lambda, yield, is, pass, and import.

01:59 Especially soft keywords are worth to be investigated further. They were introduced in Python 3.10, as you learned in this course, and we have an article about all the cool new features of Python 3.10, including examples for the structural pattern matching with match and case.

02:19 Some of the examples you found in this course were a bit isolated just to get the point across about what the keyword is. So it might make sense to use the keywords in their context, and of course we have tutorials for that. For example, how to define your own functions, how to work with files, or the general introduction to object-oriented programming. Well, actually you can jump into any tutorial or course on this website because you won’t find any tutorial or course that doesn’t contain any Python keywords. So again, thank you so much for participating in this course.

03:01 Congratulations on completing it, and see you next time.

Avatar image for kishore.99v

kishore.99v on May 10, 2025

As usual, very nice explanation @Philipp. Your presentations with explanations are awesome. Thanks!

Avatar image for enixon77

enixon77 on June 19, 2026

I love your explanations @Philipp. One thing to note on the exercise for validating soft keywords. I had my code right locally, but I was not getting the return data I expected. In your exercise, you validated that my code was right, and I got the bonus question right. Turns out my Mac is running Python 3.9, and though the docs say soft keywords were introduced, they were not implemented until 3.10. I validated this by setting up a conda env, and my code worked. This might be helpful in case someone else runs into this.

Avatar image for Bartosz Zaczyński

Bartosz Zaczyński RP Team on June 20, 2026

@enixon77. thanks for the kind words, and good detective work tracking this down!

You’re spot on. keyword.softkwlist was added in Python 3.9, but it comes back empty on that version because there were no soft keywords yet. match, case, and _ only became soft keywords in Python 3.10 with structural pattern matching (PEP 634), and type was added later in 3.12 (PEP 695). So on 3.9 your code was correct, it just had nothing to list:

>>> import keyword           # Python 3.9
>>> keyword.softkwlist
[]
>>> import keyword           # Python 3.10+
>>> keyword.softkwlist
['_', 'case', 'match']

That lines up with what you saw. The exercise checker runs on a newer Python, so it confirmed your solution, while your local 3.9 returned an empty list. Setting up a conda env with 3.10+ was exactly the right way to confirm it.

The course touches on this in Categorizing Keywords, where Philipp notes the matchcase construct is new in 3.10. Thanks for posting this. It’ll help anyone still on 3.9.

Become a Member to join the conversation.