-->

Encrypting your link and protect the link from viruses, malware, thief, etc! Made your link safe to visit.

Keywords in Python



      Keywords define the language’s rules and structure and they can’t be used as variable names.
      Python has twenty-nine keywords:
             and                   def                     exec                            if                       not                     return
assert               del                   finally             import                    or                try
             break                elif                    for                            in                 pass            while
             class                  else                  from                           is                print           yield
             continue    except        global                                    lambda                          raise


To check whether a string is keyword or not :


Python in its language defines an inbuilt module “keyword” which handles certain operations related to keywords. A function “iskeyword()” checks if a string is keyword or not. Returns true if a string is keyword, else returns false.

>>> import keyword
  
>>> keyword.iskeyword("true")
False
 




ST

Social

Recent

⬇⬇Get Your Link⬇⬇