Skip to content

Commit

Permalink
Initial keywords.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemadden42 committed Jan 1, 2024
1 parent f562f28 commit c5b52cb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions keywords.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3

import keyword


def print_all_keywords():
"""
Print the list of all Python keywords.
This function uses the keyword module to retrieve the list of keywords
in Python and prints them one by one.
Returns:
None
"""
keywords_list = keyword.kwlist
print("List of Python Keywords:")
for kw in keywords_list:
print(kw)


if __name__ == "__main__":
print_all_keywords()

0 comments on commit c5b52cb

Please sign in to comment.