Title: Data Types in Python
1Data Types in Python
Swipe
2Data Types in Python
Operator
Operator
Integers Float Complex Boolean String None
List Tuple Range Bytes Bytes Arrays Set Frozen
Set Dictionary
Numbers
Sequence
Sequence
Mapping
3Data Types in Python
- The classification or categorising of data
elements is known as data types. It denotes the
kind of value that specifies which - operations can be performed on a given set of
data. Data types are essentially classes, and - variables are instances (objects) of these
classes, because everything in Python
programming is an object.
4Number
The standard Python method is used to create
Python numbers variables. Using the regular
Python number type is usually sufficient. If
necessary, Python will automatically convert a
number from one type to another. But, under
certain circumstances that a specific number
type is needed (ie. complex) Numbers in python-
Integers Float Complex
5Integers in Python
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.
Whole number without decimal point, including.
Integers can be represent in different forms.
Integers
No concept of size for any data type in python
6Floats in Python
This value is represented by float class. It is a
real number with floating point representation.
It is specified by a decimal point. Optionally,
the character e or E followed by a positive or
negative integer may be appended to specify
scientific notation.
Real number with decimal point
Floats
Exponential from
No concept of double
7Complex numbers in Python
Complex number is represented by complex class. It
is specified as (real part) (imaginary
part)j. abj where a is real b is imaginary. j
is the square root of -. a.real b.imag
Integers
a can be decimal/binary
b can be decimal only
Except modulo operation
rest all operations are applicable.
8Topics for next Post
Data Types in Python Mutable vs Immutable Data
type in Python Stay Tuned with