input: Write a python function to check if a number is perfect.
  assert is_perfect(6) == True
  assert is_perfect(28) == True
  assert is_perfect(12) == False
  assert is_perfect(496) == True
output: def is_perfect(n):
      if n <= 1:
          return False
      divisors_sum = 1
      for i in range(2, int(n**0.5) + 1):
          if n % i == 0:
              divisors_sum += i
              if i != n // i:
                  divisors_sum += n // i
      return divisors_sum == n