Skip to content

Instantly share code, notes, and snippets.

@marcoscastro
Created March 12, 2017 21:45
Show Gist options
  • Select an option

  • Save marcoscastro/10e44e465800ec0583a4676296042fff to your computer and use it in GitHub Desktop.

Select an option

Save marcoscastro/10e44e465800ec0583a4676296042fff to your computer and use it in GitHub Desktop.
Correção número perfeito
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