Category Archives: Keywords and Identifier

Identifiers

Identifier is the name given to entities like class, functions, variables etc. in Python. It helps differentiating one entity from another.An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and digits (0 to 9).
Python doesn’t  allow  punctuation characters such as %,$ and @ within identifiers.It is a case sensitive language.

Rules for writing identifiers in Python:-
* First character must be a letter or underscore ( _ ).
* Starting an identifier with a single leading underscore indicates by convention that the identifier is meant to be private.
* Starting an identifier with two leading underscores indicates a strongly private identifier.
* Any additional character can be a letter or underscore.
* Case sensitive.(always mind it)
* It can begin with a number also.
* Identifier can be of any length.

Keywords

Keywords are the reserved words in Python. We cannot use a keyword as variable name, function name or any other identifier. They are used to define the syntax and structure of the Python language. All the Python keywords contain lowercase letters only.

Keywords in Python programming language
False class finally is return
None continue for lambda try
True def from nonlocal while
and del global not with
as elif if or yield
assert else import pass
break except in raise

you can also use command line  prompt to know about keywords,just write help() and press enter then write keywords,press enter.
It will produce following result…
help utilityYou can take help to know about any keywords of it by writing name as shown in list.