What is data type?
Data types are the classification or categorization of data items. It represents the kind of value that tells what operations can be performed on a perticular data.since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes.
Following are the standard or built in data type in python programming:-
- Numeric
- Sequence Type
- Boolean
- Set
- Dictionary
Let us discuss with all the data types one by one.
1. Numeric : - In Python numeric data type represent the data which has numeric value.Numeric value can be Integer, Floating Number or even Complex. These valuse are defined as int, float and complex in Python.
Example:- 2,3.8,-5,0 etc.
A. Integer : - This value is represented by int class. It contains positive or negative whole numbers without fraction or decimal. In Python there is no limit to how long an integer value can be.
Example :- 2,35684,-21,0 etc.
B. Float :- This value is represented by float class. It is a real number with floating point representation. It is specified by a decimal point.
Example :- 2.5,358.546 etc.
C. Complex Number : - Complex number is represented by complex class. It is specified as (real part) + (imaginary part)*j.
Example : - 2+3j
No comments:
Post a Comment