1k likes | 3.08k Views
This presentation guide you through the data types in python, numeric data types and its components integer, float and complex.
E N D
Data Types in Python Swipe
Data Types in Python Operator Operator Suite Integers List Numbers Float Tuple Complex Range Sequence Boolean Bytes String Bytes Arrays Sequence None Set Frozen Set Mapping Dictionary
Data 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.
Number 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
Integers 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
Floats 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 Exponential from Floats No concept of double
Complex numbers in Python Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. a+bj 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.
Topics for next Post Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with