Created by

theJobro
-
Информатика
-
Массив данных
-
Age 15-18
-
level: с12
-
Russian
คำแนะนำของผู้เขียน
numbers = [1, 2, 3, 4, 5] # Массив чисел
fruits = ["apple", "banana", "cherry"] # Массив строк
mixed = [1, "apple", True, 3.5] # Массив с элементами разных типов
fruits.append("orange") # Добавление "orange" в конец массива
print(fruits) # ["apple", "banana", "cherry", "orange"]
fruits[1] = "blueberry" # Замена элемента с индексом 1
print(fruits) # ["apple", "blueberry", "orange"]
numbers = [1, 2, 3, 4, 5] # Массив чисел
fruits = ["apple", "banana", "cherry"] # Массив строк
mixed = [1, "apple", True, 3.5] # Массив с элементами разных типов
print(fruits[0]) # "apple" — доступ к первому элементу
print(fruits[-1]) # "orange" — доступ к последнему элементу
Created by

theJobro
-
Информатика
-
Массив данных
-
Age 15-18
-
level: с12
-
Russian
คำแนะนำของผู้เขียน
numbers = [1, 2, 3, 4, 5] # Массив чисел
fruits = ["apple", "banana", "cherry"] # Массив строк
mixed = [1, "apple", True, 3.5] # Массив с элементами разных типов
fruits.append("orange") # Добавление "orange" в конец массива
print(fruits) # ["apple", "banana", "cherry", "orange"]
fruits[1] = "blueberry" # Замена элемента с индексом 1
print(fruits) # ["apple", "blueberry", "orange"]
numbers = [1, 2, 3, 4, 5] # Массив чисел
fruits = ["apple", "banana", "cherry"] # Массив строк
mixed = [1, "apple", True, 3.5] # Массив с элементами разных типов
print(fruits[0]) # "apple" — доступ к первому элементу
print(fruits[-1]) # "orange" — доступ к последнему элементу
อยากได้แบบฝึกหัดฟรีนับพัน (ไม่มีสิ่งรบกวนเลย)?