from array import array
from dataclasses import dataclass
# list of integer
prime_numbers = [2, 3, 5, 7, 11, 13, 17, 19]
# list of string
game_list = ["soccer", "hockey", "basketball"]
# list of mixed types
host_and_port = ["192.168.100.1", 3002]
# list of Employee
@dataclass
class Employee:
first_name: str
last_name: str
employees = [
Employee("Anton", "Pavlov"),
Employee("Elena", "Kirienko")]
# 2 x 3 grid: each row is a new list
grid = [[0] * 3 for _ in range(2)]
# Trap: * repeats the SAME row
same_row = [[0] * 3] * 2
same_row[0][0] = 1
# Typed compact array of int
numbers = array('i', [1, 2, 3, 4, 5])
print(f"{prime_numbers = }")
print(f"{game_list = }")
print(f"{host_and_port = }")
print(f"{employees = }")
print(f"{grid = }")
print(f"{same_row = }")
print(f"{numbers = }")