Numeric Data Types:
Numerous numeric kinds, such as complex numbers, floating-point numbers, and integers, are supported by Python.
int (Integer): represents complete numbers without a fractional part, both positive and negative.
Examples:
float (Floating-Point Number): Represents real numbers with a fractional part (decimal point).
Examples:
complex (Complex Number): represents numbers that have two parts: an imaginary part (represented by j for the imaginary unit) and a real part.
Examples:
Sequence Data Types:
In Python, sequences represent ordered collections of objects.
String:
A string, denoted by str, is a string that has one, two, or three quotations around it.
Strings are unchangeable once they are created; they cannot be altered.
Example:
List:
Describes a mutable, ordered set of elements. Elements in lists can be of many sorts, and their index starts at 0.
Tuples:
Denotes an immutable, ordered set of objects. A tuple's elements cannot be altered once it has been constructed.
Mapping Data Types:
Mappings are collections of key-value pairs.
Dictionary:
Indicates a mutable, unordered set of key-value pairs. Values can be any kind, but keys (such as texts, numbers, or tuples) have to be distinct and unchangeable.
Set Data Types:
Sets are unordered collections of unique elements.
Set: represents a changeable, unordered set of individual objects. The curly braces {} are used to define sets; duplicates are not permitted.
Example:frozenset: represents a set's unchangeable version. Elements cannot be added to or deleted after they are created.
Example:
Boolean Data Type: Booleans represent one of two values: True or False. The truth value of an expression is represented by the Boolean type bool. Frequently employed in flow control and conditions
Example:
Binary Data Types: In order to handle files, pictures, and other sorts of data, these data types are necessary for working with binary data.
bytes: represents a byte sequence that is unchangeable. An integer between 0 and 255 makes up each byte.
Bytearray: represents a changeable byte sequence.
memoryview: useful for big datasets, it represents a view of another binary object without transferring any data.
0 Comments