0 out of 68 challenges solved

Combine two lists by summing corresponding elements

Question:
Write a function called combine_lists that takes two lists of integers as input and returns a new list by combining the elements from both lists. The new list should contain the sum of corresponding elements from the input lists. Use list comprehension to create the new list.

Example:
Input:
List 1: [1, 2, 3, 4, 5]
List 2: [10, 20, 30, 40, 50]
Output: [11, 22, 33, 44, 55]

def combine_lists(list1, list2):
    """
    Combines two lists by summing corresponding elements.

    Args:
        list1 (list): The first input list of integers.
        list2 (list): The second input list of integers.

    Returns:
        list: A new list with the sum of corresponding elements.
    """
    # TODO: Implement the combine_lists function
    pass