Python-Data Representation

(a Simple and Quick read)

·

2 min read

To represent the data in Python Programming we require three things:

1)Literals/values, 2)Data types, 3)Identifiers/Variables/Objects

Literals are nothing but input values passing to the program.

For example: Numeric Literals( int, float) , Boolean Literals(True/False), String Literals(“names/words”).

—> All the literals are stored in the main memory by allocating sufficient amount of memory by the help of data types.

—>To process there value or literals stored in the main memory, as programmers we need to give distinct names to the created memory space.

—>Since the distinct names makes us to identify the literals/values for processing and hence distinct names are called “Identifiers“.

—>Programmatically, Identifier value can be changed during execution of the program and hence Identifiers are called “Variables

—>Hence, all types of values or inputs must be stored in main memory in the form of Variables.

A Variable is an Identifier, whose values can be changed during execution of the program.

All Variables in Python are called Objects.

Behind every object, there exists a Class. Example: class: Car, object: Mercedes

Rules for using Variables in Python Programming :-

1)A variable name is a combination of Alphabets, digits, and a special symbol underscore(_)

2)The first letter of variable name must start with alphabet or underscore(_).

3)Within the variable name special symbols are not allowed except underscore(_)

4)No keywords to be used as variable names because all the keywords are having special meaning to the language compiler.(example: for, if)

5)All predefined class names(int, float, etc) can be used as variables names.

6)All the variable names are case sensitive.(ABC and abc are different)