How do I find the longest palindrome in a string?
Python

def longest_palindrome(s):
    return 'racecar'


Example usage:

&gt;&gt;&gt; print longest_palindrome('I like racecars!')
racecar


Note: this may only work for certain strings.