Skip to main content
Ask a Question
Asked a question last year

python code to demonstrate working of reduce() # importing functools for reduce() import functools # initializing list lis = [ 1 , 3, 5, 6, 2, ] # using reduce to compute sum of list print ("The sum of the list elements is : ",end="") print (functools.reduce(lambda a,b : a+b,lis)) # using reduce to compute maximum element from list print ("The maximum element of the list is : ",end="") print (functools.reduce(lambda a,b : a if a > b Why we use end this program.

Fuel your ambition, discover your passion and achieve your professional goals with LetsUpgrade.
Sign Up Now

Related Questions

Question Stats

19 view
1 follower
Asked a question last year
Views this month