Advertisement
teslariu

Untitled

Nov 16th, 2020
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. """
  5. matriz = [[1,3,5], [2,78,-1], [1,-5,14]]
  6.  
  7. for fila in matriz:
  8.    print(fila)
  9. """
  10.    
  11. matriz = []
  12. filas = int(input("Ingrese el nro de filas: "))
  13. columnas = int(input("Ingrese el nro de columnas: "))
  14.  
  15. for fila in range(filas):  # for fila in range(3):
  16.     matriz.append([])
  17.     for columna in range(columnas): # for columna in range(4)
  18.         elemento = float(input(f"Elemento[{fila+1}][{columna+1}]: "))
  19.         matriz[fila].append(elemento)
  20.        
  21. print("Matriz ingresada:")
  22. for fila in matriz:
  23.     print(fila)
  24.  
  25. """
  26. matriz = []
  27. filas = 3
  28. columnas = 4
  29.  
  30. matriz = [[4,8,1,-2],[10,7]]
  31. matriz[1].append(7)
  32.  
  33.  
  34.  
  35.  
  36.  
  37. """
Advertisement
RAW Paste Data Copied
Advertisement