Skip to content

Instantly share code, notes, and snippets.

@nicolasfig
Created October 5, 2012 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolasfig/3840911 to your computer and use it in GitHub Desktop.
Save nicolasfig/3840911 to your computer and use it in GitHub Desktop.
Llena matrices con metodos
matriz = []
n = int(input("Ingrese el # de filas\n"))
m = int(input("Ingrese el # de columnas\n"))
"""for i in range(n):
matriz.append([])
for j in range(m):
matriz[i].append(input("Ingrese la posicion [%d][%d]" % (i,j)))
"""
def imprimir(matriz):
for i in range(len(matriz)):
print(matriz[i])
def llenarMatriz(n,m):
for i in range(n):
matriz.append([])
for j in range(m):
matriz[i].append(input("Ingrese la posicion [%d][%d]" % (i,j)))
llenarMatriz(n,m)
imprimir(matriz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment