# Python Data Hierarchy

An introduction to main Python data hierarchy

*Note: This will be updated and linked to further content development*

A subset of the data types that are built into Python.

We use numbers all the time. Numbers can either be integrals or non-integrals.

Arithmetic operators and arithmetic built-in functions will return numbers. Numeric objects are immutable. In other words, when a number is created, it cannot be changes or a number within it be replaced. Python numbers are the same as mathematical numbers, but subject to the limitations of numerical representation in computers.

*Integral**Integers**:*A whole number that can be positive, negative or zero.*Booleans**:*A data type that has one of two possible values (`true`

or`false`

)

*Non-integral**Floats**:*A number that has a`decimal`

place. We use float data type when we need more precision.*Decimals**:*The decimal data type is an exact numeric defined by its`precision`

(total number of digits) and`scale`

(number of digits to the right of the**decimal**point).*Complex**numbers**:*A combination of a real and an imaginary number in the form

where**a + bi**

and**a**

are real numbers, and**b**

is the "unit imaginary number"**i**`√(−1)`

: Fraction of a number, for example 1/8, 3/4, 5/8 etc.*Fractions*

**Sequences**: Sequences represent finite ordered sets indexed by natural numbers.: Mutable sequences can be changed after they are created.**Mutable**- Lists

: Immutable sequences can**Immutable****NOT**be changed after they are created.- Tuples
- Strings

**Sets****Mutable**- Sets

**Immutable**- Frozen sets

**Mappings**: These represent finite sets of objects indexed by arbitrary index sets.: These represent finite sets of objects indexed by nearly arbitrary values.**Dictionaries**

**Callables****User-Defined Functions****Generators****Classes****Instance Methods**(for example;**Built-in Functions**`len(),`

`open()`

)(for example;**Built-in Methods**`my_list.append(x)`

)

*None*- It means that there is no value (empty record). This can be used in function to explicitly return nothing. This type has a single value (
`singletons`

). This object is accessed through the built-in name`None`

.`None`

truth value is.`false`

*Ellipsis*- Similar to
`None`

,`Ellipsis`

has a single value. This object is accessed through the built-in name`Ellipsis`

. It is used to indicate the presence of the "**...**" syntax in a**slice**.`Ellipsis`

truth value is

.**true**

Last modified 2yr ago