returning a palindrome at an index - Python
<pre><code>def palindrome(s,index):

    if s.islower() and s.isalpha():
        num=1
        if s[index-num]==s[index+num]:
            num+=1
            return s[index-num:index+(num+1)]
        return s[index]

    return ''
</code></pre>

<p>i have to Return the longest odd-length palindrome in the string that is centered at the specified index , My Palindrome function does not work for example if i do >>>palindrome('noonoon',3) i get 'oonoo' rather than 'noonoon'</p>