input: Write a python function to print all perfect numbers up to a given number N.
  assert print_perfect_numbers(10) == [6]
  assert print_perfect_numbers(30) == [6, 28]
  assert print_perfect_numbers(100) == [6, 28]
output: def print_perfect_numbers(N):
      def is_perfect(n):
          if n < 2:
              return False
          divisors_sum = sum(i for i in range(1, n) if n % i == 0)
          return divisors_sum == n
  
      perfect_numbers = []
      for num in range(2, N + 1):
          if is_perfect(num):
              perfect_numbers.append(num)
  
      return perfect_numbers