Skip to content

Error in functional programming, exercise 3 #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SerAcero opened this issue May 8, 2025 · 1 comment · May be fixed by #313
Open

Error in functional programming, exercise 3 #312

SerAcero opened this issue May 8, 2025 · 1 comment · May be fixed by #313
Labels
advanced tutorial bug Something isn't working may2025

Comments

@SerAcero
Copy link

SerAcero commented May 8, 2025

The description says "using lower() to ensure consistent capitalization."

But the proposed solution is missing it:

def reference_exercise3(words: List[str]) -> List[Tuple[str, int]]:
    return [(k, len(list(v))) for k, v in itertools.groupby(sorted(words, key=lambda x: x[0]), key=lambda x: x[0])]

perhaps:

itertools.groupby(sorted(words, key=lambda x: x[0].lower()), key=lambda x: x[0].lower()):
@SerAcero SerAcero added the bug Something isn't working label May 8, 2025
@SerAcero SerAcero linked a pull request May 8, 2025 that will close this issue
@edoardob90 edoardob90 changed the title error in functional_programming Error in functional programming, exercise 3 May 8, 2025
@edoardob90
Copy link
Member

Thanks, @SerAcero! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced tutorial bug Something isn't working may2025
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants