Loading...
Loading...
00:00:00

Python Reserved Keywords

What Is Keywords In Python?

In python , keywords are predefined words which has some special meaning and it is basic building block of python. These keywords are define the structure and Syntax of programs. Keywords cannot be use for creating variables , function, class name or other identifiers.

If you are using an IDE these keywords will be automatically highlight. It is very helpful for identifying the keywords.

All Python Reserved Keywords

Here is the some python keywords are listed

Reserved Python Keywords
False await else import pass
None break except in raise
True class finally is return
and continue for lambda try
as def from nonlocal while
assert del global not with
async elif if or yield

These keywords are used to define the structure and logic of the code and cannot be used for any other purposes. For example, if is used for control flow statements to make decisions based on conditions, def is used to define a function, class is used to define a class, and so on.

Short Description Of Most Used Keywords

  • True - boolean value true
  • False - boolean value false
  • and - logical operators and
  • or - logical operators or
  • not - logical operator not
  • in - check value present in iterable objecs
  • is - check two identifiers are equal value or not
  • None - Null value
  • as - creating alias
  • continue continue the loop
  • break - break the loop
  • class - define a class
  • def - define the function
  • del - delete the object
  • if - Create logical condition
  • else - logical condition with if or while
  • elif - nesting if esle
  • for - for loop
  • from- import functions or class from modules
  • import- import module
  • global - define the scope
  • try - try to execute code (exception handling)
  • except - exception handling
  • with - exception handling
  • return- return the value or objects
  • while- create while loop
  • pass - do nothing