Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/11/2013, 09:22
Avatar de razpeitia
razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 1 mes
Puntos: 1360
Respuesta: multiplicar los elementos de una fila de una matriz en python

Cita:
Iniciado por Carlangueitor Ver Mensaje
¿Y tú código?
Pero si no vez que quiere que le hagamos la tarea?

Código Python:
Ver original
  1. mat = [
  2.     [1, 2, 3],
  3.     [4, 5, 6],
  4.     [7, 8, 9],
  5. ]
  6.  
  7. print [reduce(lambda x, y: x*y, row) for row in mat]

Bueno ahí tienes. ¿Preguntas? lee la documentación o de preferencia el libro que lleves el curso.