Prime palindrome
\'\'\'\nclass Solution:\n    def primePalindrome(self, N: int) -> int:\n        def getPalindromes(n: int) -> int:\n            length = n // 2\n            for
\'\'\'\nclass Solution:\n    def primePalindrome(self, N: int) -> int:\n        def getPalindromes(n: int) -> int:\n            length = n // 2\n            for i in range(10**(length - 1), 10**length):\n                s = str(i)\n                for j in range(10):\n                    yield int(s + str(j) + s[::-1])\n\n        def isPrime(num: int) -> bool:\n            return not any(num % i == 0 for i in range(2, int(num**0.5 + 1)))\n\n        if N <= 2:\n            return 2\n        if N == 3:\n            return 3\n        if N <= 5:\n            return 5\n        if N <= 7:\n            return 7\n        if N <= 11:\n            return 11\n\n        n = len(str(N))\n\n        while True:\n            for num in getPalindromes(n):\n                if num >= N and isPrime(num):\n                    return num\n            n += 1\n            \n\n\'\'\'
[]