Computer Science, asked by Gaurav6548, 1 year ago

How to check if a string is a valid keyword in Python?

Answers

Answered by jp3472401
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 swagger36
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
Similar questions