Keywords and Identifiers in Python
What's an Identifier?
A name created by the programmer to define a variable, function or class
is known as an identifier. The identifiers are used to identify these
individualities uniquely. It's important to give meaning names to the
identifiers to make the code easy readable. It'll also assist other programmers
to distinguish what the program is about.
· They're applied to
name a variable, a function, a class, a structure, a union.
· It's created to
offer a unique name to an individuality.
· They can cohere of
alphabets, figures, and underscores.
· There's no
punctuation or special symbol, except the underscore.
What's a Keyword?
The keywords are supplied by the programming language for a especial
task. They've special meanings. Keywords can not be applied as identifiers. The
keywords are also known as reserved words. When there's a statement in the
program as int number = 2; it means that the number is a variable which
contains the value 2. The int is a keyword. It informs the compiler that the
memory position can keep an integer value. When there's a statement as float
area; the float is a keyword and area is an identifier. The area variable can
hold a floating- point valuation.
· They're pre-defined
words that are reserved to work with programs.
· They ca n’t be
utilized anywhere otherwise.
· It can only hold
alphabetical characters.
· It helps
distinguish specific property which exists within a language.
Difference between Keyword and identifier
An identifier is a unique name presented to a particular variable,
function or marker of class in the program. To generate a variable, both a
keyword and an identifier are bind together.
The identifiers can be altered if wanted, while this isn't the case with
keywords, which are fixed, we can not make over it according to our need. This
content beyond elaborates the difference
between a keyword and an identifier.
Identifier and Variable
The identifier is only used to identify an reality uniquely in a program
at the time of implementation whereas, a variable is a name given to a memory
position, that's used to hold a value.
Variable is only a kind of identifier, other kinds of identifiers are
function names, class names, structure names, etc. So it can be said that all
variables are identifiers whereas, vice versa isn't true.
Conclusion
We learn about the keywords ,identifiers in python
and difference between keyword and identifier.
Both an identifier and a variable are the names distributed by users to
a particular individuality in a program.
Comments
Post a Comment