Created
March 12, 2017 21:45
-
-
Save marcoscastro/10e44e465800ec0583a4676296042fff to your computer and use it in GitHub Desktop.
Correção número perfeito
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def numero_perfeito(num): | |
| cont=1 | |
| soma=0 | |
| while cont<num: | |
| if (num%cont)==0: | |
| soma=soma+cont | |
| cont+=1 | |
| if soma==num: | |
| return True | |
| else: | |
| return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment