0% found this document useful (0 votes)
606 views

Python Reserved Words

Reserved keywords in Python are predefined words that have special meanings and syntax in the language. They are used to write programming instructions but cannot be used as identifiers for variables or functions. Python 3 has 33 reserved keywords including and, assert, break, class, continue, def, del, elif, else, except, false, finally, for, from, global, if, import, in, lambda, None, nonlocal, not, or, pass, raise, return, True, try, while, with, yield.

Uploaded by

bigm94i
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
606 views

Python Reserved Words

Reserved keywords in Python are predefined words that have special meanings and syntax in the language. They are used to write programming instructions but cannot be used as identifiers for variables or functions. Python 3 has 33 reserved keywords including and, assert, break, class, continue, def, del, elif, else, except, false, finally, for, from, global, if, import, in, lambda, None, nonlocal, not, or, pass, raise, return, True, try, while, with, yield.

Uploaded by

bigm94i
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

What are Reserved Keywords in Python?

What are Reserved Keywords in Python?

Reserved words (also called keywords) are defined with predefined meaning and
syntax in the language. These keywords have to be used to develop programming
instructions. Reserved words can’t be used as identifiers for other programming
elements like name of variable, function etc.

Following is the list of reserved keywords in Python 3

and except lambda with


as finally nonlocal while
assert false None yield
break for not
class from or
continue global pass
def if raise
del import return
elif in True
else is try

Python 3 has 33 keywords while Python 2 has 30. The print has been removed from
Python 2 as keyword and included as built-in function.

To check the keyword list, type following commands in interpreter −

>>> import keyword


>>> keyword.kwlist

1 of 1

You might also like