“matriz de append de la matriz de Python” Código de respuesta

Agregar elemento a Array Python

data = []
data.append("Item")

print(data)
Colorful Crane

matriz de append de la matriz de Python

a = [1, 2, 3]
b = [10, 20]

a.append(b) # Output: [1, 2, 3, [10, 20]]
a.extend(b) # Output: [1, 2, 3, 10, 20]
ext

matriz de append de la matriz de Python

a = [1, 2, 3]
b = [10, 20]

a = a + b # Create a new list a+b and assign back to a.
print a
# [1, 2, 3, 10, 20]


# Equivalently:
a = [1, 2, 3]
b = [10, 20]

a += b
print a
# [1, 2, 3, 10, 20]
ext

Respuestas similares a “matriz de append de la matriz de Python”

Preguntas similares a “matriz de append de la matriz de Python”

Más respuestas relacionadas con “matriz de append de la matriz de Python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código