Anonymous interview question

Palindrome substrings count using Py