Skip to content
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

Sum of Digits #49

Open
9lacksmith opened this issue Jan 6, 2025 · 1 comment
Open

Sum of Digits #49

9lacksmith opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
beginner challenge a new challenge

Comments

@9lacksmith
Copy link

9lacksmith commented Jan 6, 2025

Problem: Write a function that calculates the sum of digits of a given integer.

Explanation: This function should take an integer as input and return the sum of its digits. A simple loop can be used to extract each digit.
Function signature: def sum_of_digits(n: int) -> int:
Test cases:
sum_of_digits(1234) should return 10
sum_of_digits(987) should return 24
References:
Sum of Digits - Wikipedia
Python Integer Methods

@9lacksmith 9lacksmith self-assigned this Jan 6, 2025
@9lacksmith 9lacksmith added challenge a new challenge beginner labels Jan 6, 2025
@abdoalsir abdoalsir moved this from TODO to UNDER REVIEW in ET6 Foundations Group 17 Jan 6, 2025
@abdoalsir abdoalsir self-assigned this Jan 6, 2025
@abdoalsir
Copy link

abdoalsir commented Jan 6, 2025

Hi Panashe,
Thank you for sharing this problem, I will be reviewing it today
Can you please create a PR?

@abdoalsir abdoalsir removed their assignment Jan 7, 2025
@abdoalsir abdoalsir moved this from UNDER REVIEW to READY FOR REVIEW in ET6 Foundations Group 17 Jan 8, 2025
@abdoalsir abdoalsir closed this as completed by moving to READY FOR REVIEW in ET6 Foundations Group 17 Jan 8, 2025
@abdoalsir abdoalsir moved this from READY FOR REVIEW to TODO in ET6 Foundations Group 17 Jan 8, 2025
@abdoalsir abdoalsir reopened this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner challenge a new challenge
Projects
Development

No branches or pull requests

2 participants