Keywords and Identifiers

Last updated Aug 08, 2021

Keyword

A Python Keyword is a reversed word which you can't use as a name of your variable, class, function, etc. These keywords have a special meaning and they are used for special purposes in the Python programming language.  For example – the Python keyword “while” is used for a while loop thus you can’t name a variable with the name “while” else it may cause a compilation error. There are a total of 36 keywords in Python 3.9.

and

yield

break

continue

def

class

except

import

from

lambda

return

 

try

 

There are many keywords but these keywords are used most in the python language.

 

Identifiers

An Identifier is a name given to entities like class, functions, variables, etc. It helps to differentiate one entity from another. The variable name is known as an identifier. Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore  _ . Names like myclass, var_1, and print_this_to_screen, all are valid examples.

Article Contributed By :
https://www.rrtutors.com/site_assets/profile/assets/img/avataaars.svg

94 Views