How to check if a string is a valid keyword in Python?
Answers
Answered by
0
It also provides a dictionary with the keywords as keys, and a predicate function that can be used to check if a given word is a Python keyword. # File: keyword-example-1.py import keyword name = raw_input("Enter module name: ") if keyword.iskeyword(name): print name, "is a reserved word."
Answered by
2
In programming, akeyword is a “reserved word” by thelanguage which convey a special meaning to the interpreter. It may be a command or a parameter. Keywordscannot be used as a variable name inthe program snippet.
please mark me down for BRAINLIEST
please mark me down for BRAINLIEST
Similar questions
English,
6 months ago
Chemistry,
6 months ago
Math,
1 year ago
Political Science,
1 year ago
Geography,
1 year ago