Python keywords and Identifier


Keywords(or reserved keywords) are reserved words which can not be used as variable name, function name, class name or any other identifier. Following are the list of reserved keyword in python.

Falseawaitelseimport pass
and continueforlambdatry

We can see except FalseTrue, and  None all other keywords are in lowercase(with small letters). These keywords should be used as it is. These are used in various situation to represent expression, condition, creation of function or classes, etc.


Identifiers are the name given to an entity like function, variable, classes, etc to segregate one entity from another. These identifiers are used to access the particular variable, function or classes, etc.

Rules for creating identifier:

It is very important to note rules for creating identifiers as these rules limit what we can create and what we can not.

1. Identifier(be it a variable, function , class, or any other identifier entity) should consist of combination of letters a-z (small letters) or A-Z(capital letters) with numbers (0-9) and underscore symbol( _ ). For instance MyVariable, var_1, Num_1, x1, my_variable_name, etc are all valid identifier names. 

2. An identifier name can not start with a number. The first letter must be either letter or underscore. For example, 1var is invalid, where as var1 or _one is valid identifier name.

3. An identifier name should not be reserved keyword. Such as, try , if, def  ,etc are invalid identifier names.

4. Identifier name must not contain any white-space, or special character (!, @, #, %, ^, &, *).

5. Identifier names are case sensitive. For example, myvariable, and MyVariable is not the same.

Note: While creating variable name, function name and class name these rules must be followed.

Leave a Reply

Your email address will not be published. Required fields are marked *