logo
logo
Sign in

Python -Keyword, Identifiers and Variables

avatar
mk
Python -Keyword, Identifiers and Variables

 

In this article we will talk about the Keywords, identifiers and Variables.

Keywords

Python IDEs can be used to highlight keywords to differentiate them from other words in your code. This IDEs will help you to quickly identify Python keywords so you don’t use them incorrectly in programming.

In Python code, True keyword is used as the Boolean true value.

Python keywords are special reserved words that have specific meanings and purposes and ca not be used for anything but those specific purposes. These keywords are always available — you ’ll no way have to import them into your law. Python keywords are the abecedarian structure blocks of any Python program.

The Python keyword False is analogous to the True keyword, but with the contrary Boolean value of false.

 

 

Identifiers

 

An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique class of objects, where the" object “or class may be an idea, physical innumerable object (or class thereof), or physical noncountable substance (or class thereof).

As the name says, identifiers are used to identify a particular element in a program.

Though these are hard rules for writing identifiers, also there are some picking conventions which aren't obligatory but rather good practices to follow.

 Class names start with an uppercase letter. All other identifiers start with a lowercase letter.

Starting an identifier with a single leading underscore indicates the identifier is private.

Still, then means the identifier is language- defined special name, If the identifier starts and ends with two underscores.

While c = 10 is valid, writing count = 10 would make further sense and it would be easier to figure out what it does indeed when you look at your law after a long time.

 

Variables

 

Variables are used to store data; they take memory space grounded on the type of value we assigning to them. Creating variables in Python is simple, you just have write the variable name on the left side of = and the value on the right side, as shown below. You don't have to explicitly mention the type of the variable, python infer the type grounded on the value we're assigning.

In numerous programming languages, variables are statically compartmented. That means a variable is originally declared to have a specific data type, and any value assigned to it during its continuance must always have that type.

 

Variables in Python aren't subject to this restriction.

collect
0
avatar
mk
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more