Listing All Python Keywords
When you’re in your Python interpreter, you can import the
keyword module. That’s a module that’s built in with Python, so you don’t have to
pip install it or do some other fancy stuff. It’s just there for you. And once you have imported the
keyword module, you can type
keyword.kwlist, and then all Python keywords are listed for you. Well, when I’m saying all keywords, that’s not entirely true because in version 3.10, Python introduced soft keywords, and you can list them with
00:50 These three soft keywords you will meet later again. I will explain them for you as well, like the other keywords, but just take note that there is a small differentiation between normal keywords, or so-called normal keywords, and soft keywords.
Become a Member to join the conversation.