Write Python code to check if a string is a palindrome and to find prime numbers.