
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements