Skip to content

e46b2 - enumerate with optional argument #15

Description

@daviddoji

Hi @reuven , very nice book, I'm really enjoying doing the "beyond the exercises".

When you asked for writing the "enumerate" class passing an optional argument, did you mean to print return since the optional index or to return everything but with different indexing?

Your solution prints the following:

** Starting at 0 **
0: a
1: b
2: c
** Starting at 2 **
2: c

But I thought you were asking for this (and that's what I coded :)):

** Starting at 0 **
0: a
1: b
2: c
** Starting at 2 **
2: a
3: b
4: c

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