forked from kal179/Beginners_Python_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyKeywords.py
More file actions
14 lines (12 loc) · 423 Bytes
/
pyKeywords.py
File metadata and controls
14 lines (12 loc) · 423 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Checking is some keyword is a python keyword or not
import keyword
pythonKeywords = keyword.kwlist
getToCheck = str(input('Keyword to check : '))
check = keyword.iskeyword(getToCheck)
if check == True:
print(getToCheck + ' is a python keyword.')
else:
print(getToCheck + ' is not a python keyword.')
print('\nShowing all keywords in python : \n')
print(pythonKeywords)
# remember to test the code