Home >>Python Keywords
The reserved words in Python is known as Python Keywords.We can't use Python keywords as a variable name, function name or any other identifier.
Keyword | Description |
---|---|
and | It defines a logical operator. |
as | It is used to create an alias. |
assert | It is used for debugging. |
break | It is used to break out of the loop. |
class | It is used to define a class. |
continue | It is used to continue to the next iteration of a loop. |
def | It is used to define a function. |
del | It is used to delete an object. |
elif | It is used in conditional statements. |
else | It is used in conditional statements. |
except | It is used with exceptions. |
False | It defines a Boolean value. |
finally | It is used with exceptions. |
for | It is used to create a for loop. |
from | It is used to import specific parts of a module. |
global | It is used to declare a global variable. |
if | It is used to make a conditional statement. |
import | It is used to import a module. |
in | It is used to check if a value is present in a list, tuple, etc. |
is | It is used to test if two variables are equal. |
lambda | It is used to create an anonymous function. |
None | It represents a null value. |
nonlocal | It is used to declare a non-local variable. |
not | It defines a logical operator. |
or | It defines a logical operator. |
pass | It defines a null statement that will do nothing. |
raise | It is used to raise an exception. |
return | It is used to exit a function and return a value. |
True | It defines a Boolean value. |
try | It is used to make a try. |
while | It is used to create a while loop. |