Python data types are different in some aspects from other programming languages. It is simple to understand and easy to use. Because Python is interpreted programming language and Python interpreter can determine which type of data is storing, so no need to define the data type of memory location.
The data type determines:
- The possible values for that type.
- The operations that can be done with that values.
- Conveys the meaning of data.
- The way values of that type can be stored.
Data Types available in Python
Everything in Python programming is an object, and each object has its own unique identity(a type and a value).
There are many native(built-in) data types available in Python.
Some important are:
- Numbers: An are integers
(such as 1, 2, 3…), floats (such as 2.6, 4.8, etc.), fractions
(such as ½. ¾, etc.), or even complex numbers.
- int (signed integer)
- Strings: Sequence of Unicode characters, like an HTML document.
- Bytes/Byte array: Any type of file.
- Lists: An ordered sequence of values.
- Tuples: An ordered, immutable sequence of values.
- Boolean: Holds either true or false values.
- Sets: An unordered container of values.
- Dictionaries: A key-paired values set in an unordered way.
Because Python is a pure object-oriented programming language, so other data types are also available.