forked from MIT-Emerging-Talent/ET6-practice-code-review
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Perfect numbers #28
Labels
Comments
Mr-Glucose
closed this as completed
by moving to READY FOR REVIEW
in
ET6 Foundations Group 04
Jan 7, 2025
Closed
39 tasks
Open
43 tasks
Mr-Glucose
closed this as completed
by moving to READY FOR REVIEW
in
ET6 Foundations Group 04
Jan 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
A perfect number is a positive integer that is equal to the sum of its proper divisors (also positive integer) excluding itself.
Here's two examples of perfect numbers:
1,2 and 3 are proper divisors of 6. Then 6= 1+2+3
1,2,4,7,14 are all proper divisors of 28. Then 1+2+4+7+14
Behavior
Write a python program that takes a set of positive number and returns all the perfect numbers that is that list.
Precision:
Tests
Ensure that the function correctly identifies the divisors of a number.
Example
28 are [1,2,4,7,14]
Test the program with edge cases like 1,0, or negative numbers and handle invalid input types like strings or none.
Running the function multiple times with the same input should always yield the same output.
helpful links
[] https://www.splashlearn.com/math-vocabulary/perfect-numbers
[] https://docs.python.org/3/tutorial/datastructures.html?form=MG0AV3#list-comprehensions
The text was updated successfully, but these errors were encountered: