Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python product of list

# Python3 program to multiply all values in the
# list using lambda function and reduce()
 
from functools import reduce
list1 = [1, 2, 3]
list2 = [3, 2, 4]
 
 
result1 = reduce((lambda x, y: x * y), list1)
result2 = reduce((lambda x, y: x * y), list2)
print(result1)
print(result2)
Comment

PREVIOUS NEXT
Code Example
Python :: pandas query variable count 
Python :: write geopands into postgres python 
Python :: how to print not equal to in python 
Python :: print nested list in new lines in python 
Python :: how to make all time greeter using python 
Python :: python strftime iso 8601 
Python :: how to send a message from google form to a python 
Python :: list to set keep order python 
Python :: filter an importrange 
Python :: permutations python 
Python :: latest django version 
Python :: python text underline 
Python :: python n choose r 
Python :: python counter to list of tuples 
Python :: pandas describe get mean min max 
Python :: update python in cmd 
Python :: python format float 
Python :: Addition/subtraction of integers and integer-arrays with DatetimeArray is no longer supported 
Python :: python change base function 
Python :: python change comma to dot 
Python :: python for doing os command execution 
Python :: python project ideas 
Python :: simple thresholding with OpenCV 
Python :: matplotlib set number of decimal places 
Python :: encoding read_csv 
Python :: button in flask 
Python :: python find closest value in list to zero 
Python :: change text color docx-python 
Python :: python check variable is tuple 
Python :: download image python 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =