“Como criar uma lista da lista 2D Python” Respostas de código

Como criar uma lista da lista 2D Python

>>> l = [[1, 2, 3], [4, 5, 6], [7], [8, 9]]
>>> sum(l, [])
[1, 2, 3, 4, 5, 6, 7, 8, 9]
Obnoxious Oystercatcher

Python declare lista 2D

length, breadth = x, y
matrix = [[-1 for j in range(breadth)] for i in range(length)]
# every element is -1
Famous Finch

Respostas semelhantes a “Como criar uma lista da lista 2D Python”

Perguntas semelhantes a “Como criar uma lista da lista 2D Python”

Mais respostas relacionadas para “Como criar uma lista da lista 2D Python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código