Monday, September 16, 2019

Python Keywords

=>  keywords is nothing but reserved words.
=>  we can not use a keyword as a variable name, function name or any other identifier.
=>  in python keywords are case sensitive.
=>  there are 35 keywords in python.

   following is the example of print keywords in python.

Example:
>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

2 comments:

type keyword in python

  Python have a built-in method called as a type. If  a single argument (object)  is passed to type() built-in , it returns the type of obj...