Write a logic to find the max sum of a list in another list?



Write a logic to find the max sum of a list in another list?..

Answer / Ranjan Kishore

Here is one solution: `def max_sum(lst_of_lists):n return max(sum(sublist) for sublist in lst_of_lists)nexample:nnumbers = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]nsum_max = max_sum(numbers)nprint(sum_max)`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Should I learn r or python first?

1 Answers  


What is the difference between and ?

1 Answers  


How do you get a list of all the keys in a dictionary in python?

1 Answers  


How are the differences in help () and dir () functions?

1 Answers  


Should I learn c++ or python?

1 Answers  


How to capitalize the first letter of each word in a string (python)?

1 Answers  


How many kinds of sequences are supported by python? What are they?

1 Answers  


How would you create an empty numpy array in python?

1 Answers  


How will you convert a string to all lowercase?

1 Answers  


How do you delay time in python?

1 Answers  


What is difference between match & search in regex module in python?

1 Answers  


How do you sort in python 3?

1 Answers  


Categories