added Python solution and output
added Python with reduce lambda