Skip to content

e09b4_even_odd_sums.py should return sum of odd-indexed and even-indexed numbers #14

@khoi-thinh

Description

@khoi-thinh

The solution on github returns sum of old and even numbers which is not in line with the idea in the book.

The code can be like:

def ex9_ch4(list):
    return [sum(list[0::2]), sum(list[1::2])]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions