How to print Python`s Keywords using two lines of codes


1. Open Your Python IDLE
2. Write the code given below
3. Run code
4. Now you will get Python`s Keywords

Code 1st:

import keyword

print(keyword.kwlist)

How to print Python`s Keywords using two lines of codes | Python Coding Hub
Code 1st


Code 2nd:

help("keywords")

How to print Python`s Keywords using two lines of codes | Python Coding Hub
Code 2nd


Note:

You can not use python's keywords as a valid variable name.