Skip to content

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

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])]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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