Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # Script que imprime una matriz
- """
- matriz = 5 2 8 7
- 1 3 21 -8
- 4 12 5 4
- """
- matriz = [ [5,2,8,7], [1,3,21,-8], [4,12,5,4] ]
- # formas de imprimir una matriz
- print("Impresion lineal")
- print(matriz)
- print("\nImpresión 2D")
- for fila in matriz:
- print(fila)
- print("\nOtra forma de impresión 2D")
- for fila in matriz:
- for numero in fila:
- print(numero, end=" ")
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement