10.3. Sequences

10.3.1. One-dimensional sequences

10.3.1.1. List

data: list = ['a', 2, 3.3]
from typing import List

data: List[int] = [1, 2, 3]
data: List[float] = [1.1, 2.2, 3.3]
data: List[str] = ['a', 'b', 'c']

10.3.1.2. Set

data: set = {'a', 2, 3.3}
from typing import Set

data: Set[int] = {1, 2, 3}
data: Set[float] = {1.1, 2.2, 3.3}
data: Set[str] = {'a', 'b', 'c'}

10.3.1.3. Tuple

data: tuple = 'a', 2, 3.3
data: tuple = ('a', 2, 3.3)

data: tuple[int, int, int] = (1, 2, 3)
data: tuple[float, float, float] = (1.1, 2.2, 3.3)
data: tuple[str, str, str] = ('a', 'b', 'c')
data: tuple[str, int, float] = ('a', 2, 3.3)
from typing import Sequence


def fire_employees(e: Sequence[Employee]) -> None:
    print(employee)

10.3.2. Multidimensional sequences

10.3.2.1. List of dict

from typing import List

list_of_dicts: List[dict] = [
    {'a': 1},
    {2: 'b'},
    {3.3: 'c'}
]
from typing import List, Dict

list_of_dicts: List[Dict[str, int]] = [
    {'a': 1},
    {'b': 2},
    {'c': 3},
]

10.3.2.2. List of tuples

from typing import List

data: List[tuple] = [
    (1, 2, 3),
    (1.1, 2.2, 3.3),
    ('a', 'b', 'c'),
    ('a', 2, 3.3),
]
from typing import List, Tuple

data: List[Tuple[int, int, int]] = [
    (1, 2, 3),
    (1, 2, 3),
    (1, 2, 3),
]