Thanks. I did the same algorithm in Java, which accepted. Why my python codes not accepted?

```
class Solution(object):
def longestPalindrome(self, s):
"""
:type s: str
:rtype: str
"""
if not s:
return ''
L = len(s)
if L==0 or L==1:
return s
dp = [ [False for i in range(0, L)] for j in range(0, L) ]
for i in range(0, L):
dp[i][i] = True
maxLen = 1
start = 0
#print 1, dp, start, maxLen
for i in range(1, L):
if s[i]==s[i-1]:
dp[i-1][i] = True
if maxLen < 2:
start = i-1
maxLen = 2
#print 2, dp, start, maxLen
for l in range(3, L+1):
for i in range(0, L-l+1):
if dp[i+1][i+l-2] and s[i]==s[i+l-1]:
dp[i][i+l-1]=True
if maxLen< l:
start = i
maxLen = l
return s[start:start+maxLen]
```