n = 28
      sump = 0
      for i in range(1, n):
          if(n % i == 0):
              sump= sump + i
      if (sump == n):
          print("The number is a Perfect number")
      else:
          print("The number is not a Perfect number")
      
      Python language logo

      Perfect Number Code

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.